Thank you very much.
kontrolakka
Posts
-
Can´t Create Unit Tests -
Can´t Create Unit TestsHi, I'm developing with Microsoft Visual Studio 2005 Version 8. I want to create unit tests but can´t do so. I don't have the new test option in the solution explorer. Also, I can't add it as a project. Don't know why, I have done it in other installations. Do you know how can I add the possibility to create unit tests in C# in Visual Studio 2005? Do I require the team edition? Thanks Martín
-
How can I avoid waiting for a response after an HttpWebRequest POST?Thanks again for your help. xibeifeijian, won't that create a new thread to hear for the async answer? Thanks. Martín
-
How can I avoid waiting for a response after an HttpWebRequest POST?Thanks for your answer. If I use a WebService, won´t I have a lot of extra overhead? I´m trying to avoid overhead as much as possible. Thanks again. Martín Suárez Viacava
-
How can I avoid waiting for a response after an HttpWebRequest POST?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