Click here to Skip to main content
16,005,682 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to change the color of TEXT programmatically? Pin
Paul Conrad1-Jun-07 16:46
professionalPaul Conrad1-Jun-07 16:46 
Questionhow to print any control in vc#2005 ? Pin
hdv2121-Jun-07 14:45
hdv2121-Jun-07 14:45 
AnswerRe: how to print any control in vc#2005 ? Pin
mikker_1232-Jun-07 16:49
mikker_1232-Jun-07 16:49 
Questionfade in /fade out Pin
half-life1-Jun-07 14:21
half-life1-Jun-07 14:21 
AnswerRe: fade in /fade out Pin
xibeifeijian1-Jun-07 18:50
xibeifeijian1-Jun-07 18:50 
GeneralRe: fade in /fade out Pin
half-life2-Jun-07 1:36
half-life2-Jun-07 1:36 
Questionusercontrol Pin
half-life1-Jun-07 14:20
half-life1-Jun-07 14:20 
QuestionHow can I avoid waiting for a response after an HttpWebRequest POST? Pin
kontrolakka1-Jun-07 9:40
kontrolakka1-Jun-07 9:40 
I’m POSTING to an ashx file from my aplication.
What I want to do is just post information about some variables of my aplication, and never wait for an answer.
What I need is to avoid waiting for an answer, because I don’t need it.
I’m accesing the file this way.

-----------------------------
string queryString = "http://website/PrivateHandler.ashx";
System.Net.HttpWebRequest myHttpWebRequest = (System.Net.HttpWebRequest)WebRequest.Create(queryString);

myHttpWebRequest.Method = "POST";
myHttpWebRequest.ContentType = "application/x-www-form-urlencoded";
string strRequest = "mode=1&bID=1&gID=1";

UTF8Encoding objUTF8Encoding = new UTF8Encoding();
byte[] arrRequest = objUTF8Encoding.GetBytes(strRequest);
myHttpWebRequest.ContentLength = arrRequest.Length;
Stream strmRequest = myHttpWebRequest.GetRequestStream();

strmRequest.Write(arrRequest, 0, arrRequest.Length);
strmRequest.Close();

//Wait for an answer (I don’t need an answer).
System.Net.WebResponse resp = myHttpWebRequest.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());
sr.ReadToEnd();
---------------------------------

WebResponse and ReadToEnd are there because if I don’t read what return, I can only call the ashx file twice and then the system hangs.

What I need is to post multiple times and never wait for an answer and waste performance because of that.

Is there a way to achieve what I need?

Thank you very much.



Martín Suárez Viacava
AnswerRe: How can I avoid waiting for a response after an HttpWebRequest POST? Pin
Not Active1-Jun-07 10:06
mentorNot Active1-Jun-07 10:06 
GeneralRe: How can I avoid waiting for a response after an HttpWebRequest POST? Pin
kontrolakka1-Jun-07 10:18
kontrolakka1-Jun-07 10:18 
GeneralRe: How can I avoid waiting for a response after an HttpWebRequest POST? Pin
Not Active1-Jun-07 11:14
mentorNot Active1-Jun-07 11:14 
AnswerRe: How can I avoid waiting for a response after an HttpWebRequest POST? Pin
xibeifeijian1-Jun-07 21:51
xibeifeijian1-Jun-07 21:51 
GeneralRe: How can I avoid waiting for a response after an HttpWebRequest POST? Pin
kontrolakka4-Jun-07 19:24
kontrolakka4-Jun-07 19:24 
AnswerRe: How can I avoid waiting for a response after an HttpWebRequest POST? Pin
Hesham Yassin6-Jun-07 8:39
Hesham Yassin6-Jun-07 8:39 
QuestionReading USB ID Pin
SpaceMonkey19661-Jun-07 9:18
SpaceMonkey19661-Jun-07 9:18 
AnswerRe: Reading USB ID Pin
simplicitylabs1-Jun-07 10:02
simplicitylabs1-Jun-07 10:02 
QuestionCsemaphore,C# Pin
vunhat1-Jun-07 9:01
vunhat1-Jun-07 9:01 
AnswerRe: Csemaphore,C# Pin
Giorgi Dalakishvili1-Jun-07 9:19
mentorGiorgi Dalakishvili1-Jun-07 9:19 
QuestionHow to get all the instance of a windows Service using WMI? Pin
sundar1561-Jun-07 8:24
sundar1561-Jun-07 8:24 
AnswerRe: How to get all the instance of a windows Service using WMI? Pin
kubben1-Jun-07 8:53
kubben1-Jun-07 8:53 
GeneralRe: How to get all the instance of a windows Service using WMI? Pin
sundar1561-Jun-07 9:06
sundar1561-Jun-07 9:06 
QuestionHow to access the data in a "DataSet" rather than a "DataGridView"? Pin
Khoramdin1-Jun-07 8:24
Khoramdin1-Jun-07 8:24 
AnswerRe: How to access the data in an "DataSet" rather than DataGridView? [modified] Pin
Giorgi Dalakishvili1-Jun-07 8:31
mentorGiorgi Dalakishvili1-Jun-07 8:31 
Questionshortcut to trigger event when not in focus Pin
crash8931-Jun-07 7:44
crash8931-Jun-07 7:44 
AnswerRe: shortcut to trigger event when not in focus Pin
kubben1-Jun-07 7:51
kubben1-Jun-07 7:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.