Questions tagged [system.net]

System.Net is a namespace of the .NET framework. It provides a simple programming interface for many of the protocols used on networks today.

System.Net is a namespace of the .NET framework. It provides a simple programming interface for many of the protocols used on networks today.

References

297 questions
1
vote
1 answer

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…
StarBright
  • 251
  • 1
  • 2
  • 5
1
vote
1 answer

How to distinguish between Socket Objects

Hello I am creating a card game and using System.Net and System.Net.Sockets classes. What I am having a hard time doing is figuring out how I am going to distinguish who did what and who to send that packet of information to. For example here is…
Timg
  • 227
  • 1
  • 3
  • 12
1
vote
1 answer

Does ServicePointManager.Expect100Continue = false remain set application-wide after setting it once?

I have the following code: ServicePointManager.Expect100Continue = false; on my main windows form frmMain_Load event. I have many forms and classes where different web services are called but these are always called after completion of frmMain_Load…
Computer User
  • 2,839
  • 4
  • 47
  • 69
1
vote
2 answers

Cannot implicitly convert type 'System.Version' to 'System.Net.HttpVersion'

Consider the following code: void Main() { HttpVersion version; string s = "HTTP/1.1"; version = s == "HTTP/1.1" ? HttpVersion.Version11 : HttpVersion.Version10; } This throws the error Cannot implicitly convert type 'System.Version'…
Jeroen Vannevel
  • 43,651
  • 22
  • 107
  • 170
1
vote
1 answer

Missing Method exception mono

I want to execute my C# app, compiled in Windows, on my Ubuntu Server. I am using the .Net Framework version 4.5 (can't change it cause of some 3rd party api's). I have the most actual Mono version (2.10.8) for Ubuntu installed. My Application is…
Iwan1993
  • 1,669
  • 2
  • 17
  • 25
1
vote
10 answers

Ping always succeeds, cant easily check uptime using ping on a url

Im getting frustrated because of OpenDNS and other services (ie: roadrunner) that now always returns a ping even if you type any invalid url ie: lkjsdaflkjdsjf.com --- I had created software for my own use that would ping a url to verify if the site…
schmoopy
  • 6,419
  • 11
  • 54
  • 89
1
vote
0 answers

System.Net.Cookiecontainer does not handle expires time correctly

piece of code to talk about. var client = new RestClient(URL); client.CookieContainer = new System.Net.CookieContainer(); var loginRequest = new RestRequest(loginURL, Method.GET); RestResponse response =…
kars7e
  • 786
  • 1
  • 6
  • 19
1
vote
1 answer

VB.NET Upload Issue - You must write ContentLength bytes

I am getting the following exception thrown when using the function below to upload a video file to my web server. I am using this function as I need the memory usage to be low as the video files being uploaded are in excess of 150MB. The error that…
Chris
  • 512
  • 1
  • 16
  • 33
1
vote
3 answers

Error when downloading the file C#

My code: string dir = "/Users/valeria/Desktop/screening/"+cell; string remoteUri ="http://www.broadinstitute.org%2Fcmap%2FviewScan.jsp%3Ftype%3DCEL%26scan%3D"+p; string pFileName = dir + "/p"; using (WebClient myWebClient =…
user2080209
  • 749
  • 3
  • 8
  • 25
1
vote
3 answers

HttpWebRequest.Address vs HttpWebResponse.ResponseUri

Whats the difference between these two properties? To put into context, I am determining if a redirect occurs if our ResponseUri != RequestUri. While a redirect occurs regardless the url http://adage.com/adages/article?article_id=140560 will provide…
Pat
  • 5,263
  • 1
  • 36
  • 53
1
vote
3 answers

How do you set ContentDisposition in a LinkedResource?

Is there a way to set the ContentDisposition of a LinkedResource to be inline, ie in the case of an image? Here's how I am building my LinkedResource right now: Dim img As LinkedResource = New LinkedResource(filePath) Dim…
tacos_tacos_tacos
  • 10,277
  • 11
  • 73
  • 126
1
vote
2 answers

How to grab data off a json URL and place on form?

The following URL represents a long string of data: http://api.bitcoincharts.com/v1/markets.json I noticed at the end of the url it was a .json extension, so I already researched about that. Ive downloaded JSON.NET and referenced it in my c#.net…
Andrew
  • 552
  • 2
  • 10
  • 29
1
vote
1 answer

monotouch webexception can't be caught within try/catch when data is reading from received response stream

My application for IOs sends request to service, which sends some data with specified frequency (as usual 2 or three times per second). After 15 or 20 minutes I get WebException, wich can't be caught by try/catch block. The exception is thrown when…
vklu4itesvet
  • 375
  • 1
  • 4
  • 15
1
vote
1 answer

LINQPad and System.Net tracing

I am trying trace a LINQPad script. I have setup System.Net tracing according to http://msdn.microsoft.com/en-us/library/ty48b824.aspx. I have put following lines into the LINQPad.exe.config file:
TN.
  • 18,874
  • 30
  • 99
  • 157
1
vote
1 answer

Dns.GetHostEntry doesn't convert string which contains IP

The function Dns.GetHostEntry doesn't handle ipaddresses as strings e.g. 127.0.0.1 but if I pass google.de as a parameter it works quite well. Am I doing something wrong ? public static Socket connSock(string Server, int Port) { Socket s =…