|
I do not understand.
Please explain how setting the MultiColumn property to true will help the OP to check a CheckBox in theirCheckedListBox.
Qendro wrote: its not nessesary to do it by writitng code
The OP has already indicated that they are trying to do this in code.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
hello sir,
i got an api for sending sms.i am implemneting it in my software.the hosting company has sent me the url and some codes.when pasting the url in my browser followed by my mobile no and message.then i am able to get the sms.but i have designed a windows form which contains 2 textboxes such as for mobile no and message respectively.and a send button.i want the mobile no and message from textboxes will pass as parameters in the url.how will i pass this value?please help my,its urgent.
i am posting details of my code:
----------------------------------
private static string CALLURL(string url)
{
string Res = "";
try
{
HttpWebRequest gatewayReq; //Used for HTTP Request
HttpWebResponse gatewayRes; //Used for HTTP Response
gatewayReq = (HttpWebRequest)WebRequest.Create(url);
gatewayReq.Timeout = 60000;
gatewayReq.Method = "GET";
gatewayRes = (HttpWebResponse)gatewayReq.GetResponse();
Stream ReceiveStream = gatewayRes.GetResponseStream();
StreamReader sr = new StreamReader(ReceiveStream);//, System.Text.Encoding.ASCII);
Res = sr.ReadToEnd();
MessageBox.Show("message sent successfully.");
}
catch
{
//Res = "URL is not responding at the moment.";
//WriteErrorLog(DateTime.Now + "|" + "Call URL Function: " + ex.Message.ToString());
MessageBox.Show("Sorry,Unable to send Sms.Try Again Later.");
}
return Res;
}
private void send_Click(object sender, EventArgs e)
{
string url;
string msg;
Int64 no;
no = Convert.ToInt64(textBox1.Text);
msg = textBox2.Text;
url = "http://203.212.64.15/genericpushnew/pushsms.aspx?userid=demo123&password=hotmail01&masking=CVRTNP&mobileno=no&message=msg";
CALLURL(url);
}
}
|
|
|
|
|
Use this:
url = string.Format("http://203.212.64.15/genericpushnew/pushsms.aspx?userid=demo123&password=hotmail01&masking=CVRTNP&mobileno={0}&message={1}",
Convert.ToInt64(textBox1.Text), textBox2.Text);
|
|
|
|
|
well its quite easy but ur calling the functions in a wrong way....
We did the same project in VB,C# as well as asp.net successfully.
9870187165
|
|
|
|
|
I am spliting html code with this separators:
string[] datum = new string[] { "<td class=\"datum\">", "</td>" }
Now I split whole html code like this..
string[] datumi=skupaj.Split(datum, StringSplitOptions.RemoveEmptyEntries)
Now i have at datumi[0] empty string..than at datumi[1] full...then again empty..and full etc.
How to get rid of this empty string??
|
|
|
|
|
Aljaz111 wrote: How to get rid of this empty string??
result = s2.Split(stringSeparators, StringSplitOptions.RemoveEmptyEntries); Source[^]
I are Troll
|
|
|
|
|
Exactly what the OP is doing. Read a little closer before replying.
Eddy Vluggen wrote: I are Troll
At least that is correct.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: Exactly what the OP is doing. Read a little closer before replying.
I'll try. Once you answer a number of questions, you're bound to make a mistake somewhere.
Mark Nischalke wrote: At least that is correct.
I do make an effort out it
I are Troll
|
|
|
|
|
Hi,
Without seeing an example of the skupaj string it's difficult to be sure what is wrong but String.Split will not be producing empty strings. It is likely that the apparently empty strings contain either non-printing or white space characters and my guess would be line endings.
Alan.
|
|
|
|
|
How empty is empty?
|
|
|
|
|
I added to application app.config file and can access it successfuly.
However after I copied the exe with app.config file to another machine it fails to read its settings returning null values string value = ConfigurationManager.AppSettings["MyValue"];
Also when I change from text editor app.config file on original machine used for project compilation, these values do not get updated when they are read from exe application.
Only when I change those values from VS in app.config file.
How exe locates its app.config file?
Чесноков
|
|
|
|
|
|
I am debugging a program that combines several wav files into one. This code always gives me an error message:
try
{
outFileStream = new FileStream(outputFile, FileMode.Create);
}
catch (Exception ex)
{
MessageBox.Show(ex.GetBaseException().ToString());
}
The error message is:
System.IO.IOException: The process cannot access the file 'C:\Documents and Settings\ .... \02.wav' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at LiveDescribe.WavFile.writeAudioFileHeader(String outputFile, Boolean pStereo) in C:\Documents and Settings\ .... \WavFile.cs:line 503
note: line 503 is the line outFileStream = new FileStream(...)
How can I make it work?
Thanks.
|
|
|
|
|
When you open like this
outFileStream = new FileStream(outputFile, FileMode.Create);
it will first delete the existing file(if any) and then create a new file.
I think the file is exclusively locked by some other process or the process itself where you are working on. This happens if you try to open a file without closing the file in previous occation.
Check your code, if some other process has left the file open so operating system cannot delete the file.
|
|
|
|
|
First, find what process is using the file. My best guess: it is your program.
Inside the try...catch block, add a using block:
try
{
using (outFileStream = new FileStream(outputFile, FileMode.Create))
{
...handle your file here...
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
What this does is ensure that the open file is fully closed and disposed before your app tries to open it again.
You may also want to replace the file mode with FileMode.OpenOrCreate
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I have tried your solution (using ...) and it's still giving me the same error. Once it hits the using line it jumps to the catch exception line.
|
|
|
|
|
Then the file is genuinely in use by either another part of your app, or by another app.
Are you taking three files, reading them and then trying to overwrite the first one? Or outputing to a fresh file?
Try changing the output file to a new, fresh folder that nothing else will be using. Does this cure the problem?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I am taking a bunch of wav files and try to combine them by inserting smaller wav files into an original big wav file. (ie. I have a 45 min long wav file and I am trying to insert or merge 30sec long wav into that 45min wav file, outputting a new file where all wav files are merged.) The program uses file selection dialogue box so the user can choose where to save the output file. I tried saving the file in C:\ and no luck.
|
|
|
|
|
So your progam logic goes:
1) open big file
2) read big file into memory
3) close big file
4) Open small file, read , insert into big file data in memory, close small file
5) Open small file, read , insert into big file data in memory, close small file
6) Open output file, write memory to output, close output.
Yes?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I believe it keeps a list of files to read from in memory, and then reads each file and write it to the output file.
|
|
|
|
|
Thanks so much for the replies. I just found out the whole program won't run on my netbook so I'll have to test it out tomorrow, but meanwhile I can provide a bit more details on the code.
The main program creates a WavFile object, which has the following code:
string destinationFile = *some path, due to spacing I left it out;
string originalFile = some path + Path.GetFileNameWithoutExtension(projSettings.SaveFileName) + "_audio.wav";
WavFile wf = new WavFile(originalFile, destinationFile, this);
...
And then the WavFile class has the following constructor:
public WavFile(string videoAudioFile, string desFileName, mainparentMain){
...
outfileName = desFileName;
videoAudioFileName = videoAudioFile;
...
writeAudioFileHeader(outfileName, true);
}
The method writeAudioFileHeader is the code I've posted in my original post.
I stepped through the code to see where outFileStream is declared or used elsewhere but I can't find it used before line 503 writeAudioFileHeader method, it is declared as a private FileStream variable in WavFile class and it's not initialized until line 503. I can't figure out what's using it before it's initialized
But thanks so much for the replies.
|
|
|
|
|
Dear All,
I am using windows 2008, VS 2008, and SQL Server 2008.
I built a windows application which reads data from SQL 2008.
when I install this application into windows 2008 , it runs successfully and read the data successfully.
But when I install this application on windows XP, it runs successfully but it does not read any data in its forms.
I installed Dot Net framework 3.5 SP1 on the windows XP machine, and it did not work.
I searched google with no results.
Please help
Kind Regards
OBarahmeh
modified on Monday, November 2, 2009 3:41 AM
|
|
|
|
|
This may seem like a stupid question, but do you have SQL server installed on the XP machine you are having trouble with?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
It is not a stupid question, because the SQL Server is installed on the server, and the client login with a user name and password which have read access into the database.
Kind Regards
OBarahmeh
|
|
|
|
|
After I sent data to connect TcpClient with TcpListener BeginWrite().
In Async write data handler I need to disconnect client. I do that immediatly after EndWrite() call. But in that case client gets disconnected before it invokes ReadData() method.
How to wait until client will recieve the data?
Strange, that happen only in Release mode. In Debug mode there are no such problems.
Чесноков
modified on Sunday, November 1, 2009 5:53 AM
|
|
|
|