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

Retrieve a string containing html Document source using Task parallel

I really hope there's someone experienced enough both with TPL & System.Net Classes and methods What started as a simple thought of use TPL on current sequential set of actions led me to a halt in my project. As I am still fresh With .NET, jumping…
LoneXcoder
  • 2,121
  • 6
  • 38
  • 76
1
vote
0 answers

Downloading Files - ConnectStream.Read Timed Out

Problem - When downloading a number of files either through a WebClient or a HTTPWebRequest the download will randomly but regularly hang and give a "System.Net.WebException: The operation has timed out.". When using the HTTPWebRequest I can tell…
stevehipwell
  • 56,138
  • 6
  • 44
  • 61
1
vote
2 answers

nullreference of system.net.sockets on monotouch

I have three versions of the same application: iPhone, Mono Console, Windows Console application. All of them contain exactly the same code (via MonoTouch C#). On the Mono(Touch) framework I get the following exception from the Assembly Browser:…
r712m
  • 299
  • 3
  • 7
1
vote
1 answer

C# The attempted operation is not supported for the type of object referenced

I got this error when I tried to parse an IP address that was in string form. I was using a public dns ip address (4.2.2.2) while testing this (using the System.Net's IPAddress.Parse method). It does the parsing correctly and returns an IPAddress…
Babu James
  • 2,740
  • 4
  • 33
  • 50
0
votes
2 answers

PowerShell - Dispose System.Net.CookieContainer?

Is there a way to dispose/close the CookieContainer? $cc = New-Object System.Net.CookieContainer
LaPhi
  • 5,675
  • 21
  • 56
  • 78
0
votes
0 answers

ServicePointManager not initialised when in CLR class library?

I've inherited a CLR class library (.NET Framework 4.7.2) that provides a function which queries table storage in Azure. The function, called from a native C++ executable, is currently failing because the TLS settings are insufficient. If I query…
0
votes
0 answers

How to manage packets in a custom server

Context: I want to make a multiplayer game with unity and i would like to make dedicated servers for players to be able to open their own server. I haven't made the game yet, i'm just experimenting with my server and a test client. The server is a…
Zartox29
  • 81
  • 8
0
votes
0 answers

Why am I getting 'Authentication required' error when sending email in Android .NET MAUI?

I am having this error when sending an email from the android App in .Net MAUI Version 6.0, before my code was working perfectly but now it is giving the error said:Error sending email: The AMTP server requires a secure connection or client was not…
0
votes
0 answers

Why does NetworkChange.NetworkAddressChanged keep getting raised?

I am running .NET 7 on Linux. I tried get network change information with the following code, but I keep getting the event, even though the computer is constantly on, and it is a wired Ethernet. The addresses seem the same. Then, why is "network…
Damn Vegetables
  • 11,484
  • 13
  • 80
  • 135
0
votes
1 answer

How to get Local Router Address[Not IPV4 address of device] in Xamarin

I have tried below code but it keeps on giving the me iPhone(ie.Device) IP Address. But I want to get a ROUTER IP ADDRESS public string GetIPAddress() { String ipAddress = ""; foreach (var netInterface in…
iTag
  • 409
  • 3
  • 19
0
votes
0 answers

Directly check a domain's SSL certificate without a callback in C#

I'm attempting to directly retrieve the SSL certificate for a given domain, so that I can access its fields (such as Issuer, Expiration date, Errors, etc). All the non-deprecated examples I can find, including from Microsoft, make use of the…
user4779
  • 645
  • 5
  • 14
0
votes
1 answer

How to create new ServerSocket C#

using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Net.Sockets; namespace PowerCarsMobileServer { class Server { public static int Port { get; private set; } private static…
0
votes
0 answers

"425 Unable to build data connection" when attempting to download files from a FTPS server using .Net with TLS 1.3

I'm attempting to download files from an FTPS server using the functionality provided by System.Net (.Net Framework 4.8). I'm using the following code: var serverUri = new System.Uri("ftp://my.ftp.server.com/directory/"); var request =…
Krys
  • 39
  • 9
0
votes
1 answer

Is HttpWebRequest kind of obsolete, should HttpRequestMessage + HttpClient be used instead now, since what version of .NET?

There is a similar question but my questions seems more general I've went through a few git repos and noticed Request/Response wrappers over HttpRequestMessage like CryptoExchange.Net.Requests.Request /// /// Request object, wrapper for…
Artem Vertiy
  • 1,002
  • 15
  • 31
0
votes
1 answer

Can't import System.Net.Http on VB.Net page

I'm trying to use HttpClient on a VB.NET page (Windows Server 2019 IIS 10), but getting BC30002 error. Tracing the error in IIS, I see warning BC40056 (Namespace not found) on line: Imports System.Net.Http Running gacutil, seems that the assembly…
Massimo
  • 90
  • 1
  • 8