system.net

Toggling TraceSwitch at runtime

I'm trying to get access to some diagnostic information available in the .NET System.Net tracing functionality in my application. I am aware that I can set the tracing level using the appropriate .config, but I was hoping to be able to toggle the switch programatically. (i.e. turn tracing on during particular parts of my program execut...

(.NET) ServicePoint.IPEndPointDelegate doesn't callback with proxy?

I need to bind the local ip address for an HttpWebRequest (machine has multiple ips). I create the delegate method, and this is called and the ip is bound for requests without a proxy, but once i add proxy details to the request, the callback never occurs How can i bind the outgoing ip address for HttpWebRequests that use a proxy? ...

programmatically access different NICs when sending web request.

Hi all, hobbyist/non-profession programmer here. I don't have a strong grasp on network addressing. I have a computer that simultainiously connects to two different networks. 1 through wireless, one by network cable. In my DotNet (c#) windows form app, I would like it to send some requests to one of the networks through one of the NIC...

What sense does asynchronous IO make if the thread is blocked anyway (see example)

Hello, I found an example for async ftp upload on msdn which does the following (snippet): // Asynchronously get the stream for the file contents. request.BeginGetRequestStream( new AsyncCallback (EndGetStreamCallback), state ); // Block the current thread until all operations ar...

system.Net Tracing - Not able to view Request Body in single line

Hi All, I am using system.Net tracing to log what is being sent over the wire. I am able to see the Http Request Body content but are in seprate lines. I want to see like below <s:Envelope xmlns:s="http://schemas.xmlsoap.org/.........................&lt;/s:Envelope&gt; Not like this System.Net Verbose: 0 : [118756] Data from Connec...

question about System.Net

hi all. when i use some code like this: System.Net.WebClient objClient = new WebClient(); string url = "http://google.com"; objClient.DownloadString(url); it takes some seconds to connection stablished and downloading starts... i reinstall my windows yesterday. before yesterday i havent this problem. some times when i reinstall my wi...

HttpWebRequest.UserAgent : What does it do

I read this MSDN like about it and ran its example. http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.useragent.aspx when I change the uSerAgnet to something like "blah", the output is wrong but when I use the same thing that is in the example of even when I comment out the line of code that is setting the UserASgent, th...

Traverse ftp subfolders to get file sizes in C#

Hi all, Was wondering if you could point me at a right direction on how to achieve this... I'm currently working on an application that will check the filespace consumed in a remote FTP server that has folders, subfolders and files. I managed to get some information using System.NET via FtpWebRequest, FtpResponse, WebRequestMethods & ...

Avoid exception in WebRequestObject

I am reading data from a website as follows: webRequestObj = (HttpWebRequest)WebRequest.Create("http://localhost/503errorPage.php"); theResponse = webRequestObj.GetResponse(); theResponseStream = theResponse.GetResponseStream(); theStreamReader = new StreamReader(theResponseStream); theWholePage = theStreamReader.ReadToEnd(); If I get...

How to check if Web server is up? (C#)

I am building a monitoring application to continuously monitor all aspects of my system. I was hoping to use the Ping() function to determine if the server is up but the MSDN documentation itself says that it is not the best way: A successful Ping indicates only that the remote host can be reached on the network; the presence of ...

Effect of System.Net Connection Management

<system.net> <connectionManagement> <add maxconnection="1000" address="*"/> </connectionManagement> </system.net> Can someone tell me if this setting affects my WCF (basicHttpBinding) services? ...