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
2
votes
1 answer

programmatically access different NICs when sending web request

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…
SteveH
  • 23
  • 2
2
votes
1 answer

Clear System.Net.WebClient DNS cache

How can one clear the DNS cache of System.Net.WebClient as used by a site hosted on Azure Web Sites? Related: How do I clear System.Net client DNS cache? I don't wish to modify the code though, I'd like to keep using the cache, but only flush it…
tne
  • 7,071
  • 2
  • 45
  • 68
2
votes
0 answers

Why do I get (407) Proxy Authentication Required in a WinForms app and not a Console app?

I've got a problem getting my software to communicate through a proxy server at a client's site. It just gets (407) Proxy Authentication Required errors. It's a .NET Framework 3.5 C# WinForms application which uses old-style asmx web references to…
2
votes
3 answers

How to specify the number of bytes to send when using Socket.SendToAsync()?

I have ported my UDP based protocol implementation from using the Socket.BeginXXX methods to the Socket.XXXAsync methods as they take the SocketAsyncEventArgs class which has Buffer, Offset and Count properties so a single large buffer can be…
markmnl
  • 11,116
  • 8
  • 73
  • 109
2
votes
2 answers

The difference between with System.Net and without System.Net

What is the difference between adding System.Net like this: CookieContainer globalcontainer = new System.Net.CookieContainer(); and using the class without the namespace in the declaration CookieContainer globalcontainer = new…
Wendy Lam
  • 21
  • 5
2
votes
1 answer

DNS Refresh Timeout with Mono

Although the current Mono project's ServicePointManager class has the DnsRefreshTimeout property enabled into its interface. The related property isn't implemented. Sample call: ServicePointManager.DnsRefreshTimeout = 10*60*1000; // 10 minutes When…
georgepiva
  • 874
  • 9
  • 29
2
votes
3 answers

Can't Install System.Net.Http Package into a Windows Phone 7.1 Silverlight Project

I used Nuget to install the "Microsoft ASP.NET Web API Client Libraries" to get the latest System.Net.Http assembly for use in Windows Phone 7.1 XNA and Silverlight projects. It installs just fine into my WP7.1 XNA projects, but doesn't allow me to…
1
vote
0 answers

clear connection pool used by System.Net.WebClient

Does anyone know how to clear the connection pool of System.Net.WebClient, or to force such a client to use a new connection for a request? (likewise, if I could do the same with a HttpWebRequest that would be fine)
Frank Schwieterman
  • 24,142
  • 15
  • 92
  • 130
1
vote
1 answer

C# - Need help connecting to IPEndPoint

Ok, I am trying to use the System.Net.Sockets part of the .Net Framework 4 to connect to an IPEndPoint. First I declare the IP address as a variable like so IPAddress myIpAddress = IPAddress.Parse("10.10.15.200"); Then I declare my IP endpoint as a…
JMK
  • 27,273
  • 52
  • 163
  • 280
1
vote
0 answers

System.Net library is limiting outgoing requests to only two threads

I am working on old project, and I found weird problem, which I am not able to explain. It is about communication from my client app to server app. Server is running under IIS app pool and client is running localy (console app). In Client app…
1
vote
5 answers

Getting '(400) Bad Request' with GetResponseStream() in C#

I am using the following code to send a get request to facebook graph api oauth server. public string GetAccessToken(string code) { HttpWebRequest req = (HttpWebRequest)…
1
vote
1 answer

What is the nslookup equivalent in C#?

I want to get the aliases that is returned by nslookup as below: F:\>nslookup maans20210630125234.sandbox.operations.test.dynamics.com Server: UnKnown Address: 2001:4898::1050:1050 Non-authoritative answer: Name: …
1
vote
1 answer

No local IP found

I want to get the local IP-Address from any Windows device. It works fine for my Desktop-PC. But when I try to get the IP of my laptop or my surface I always get 123.123.123.123. foreach (NetworkInterface nInterface in…
Kaskorian
  • 426
  • 3
  • 18
1
vote
0 answers

IPEndPointCollection missing under System.Net

(If this is a dumb question I apologies for it, but I'm new to C# language). I'm creating a P2P system in C# with Visual Studio 2019 and I need the IPEndPointCollection class, but I don't find it under System.Net, only IPEndPoint appears. I've…
1
vote
0 answers

Game-Server running on local machine but not on ubuntu server

My Server (System.Net) is working on my local mashine (win10), but not on the ubuntu server, i get this error: Unhandled exception. System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'size') at…
Nissl
  • 13
  • 2
  • 4