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
0
votes
0 answers

Difference between http webrequest and web client?

To upload large data when I use http web request it gives me time out error, but when I use web client,it uploads without any problem. I read on the internet that web client is nothing but abstraction of http webrequest. So, what is different…
V K
  • 1,645
  • 3
  • 26
  • 57
0
votes
0 answers

WebClient.DownloadData() returns 404 with .axd

I'm trying to download a .axd picture link, but I'm getting not found error(404). In local server, works fine, but I get 404 on production Server. Is there anything I must to set up in web.config or something? public System.Drawing.Image…
0
votes
1 answer

Google.Apis.Http.ConfigurableMessageHandler exception at runtime

I have problem with Google Analytics API .NET. While connecting to GA via api at line var certificate = new X509Certificate2(pathToPrivateKey, passToPrivateKey, X509KeyStorageFlags.Exportable); ServiceAccountCredential credential =…
0
votes
1 answer

Get all the shared folders of a computer in my network

I want to get all the computers in my network and all the shared folders in it(Should work in both domain and workgroup). I was able to get all the computers in the network using below code Dim ipproperties As NetworkInformation.IPGlobalProperties =…
IT researcher
  • 3,274
  • 17
  • 79
  • 143
0
votes
1 answer

Multi-Thread download

I have wrote test-code that below. It works, but not as I expected to. For some reason it works only for two threads from seven, another threads wait for that working threads finished their tasks. Why this happens and how to fix it ? Please help…
L6go1as
  • 39
  • 9
0
votes
1 answer

Exception thrown while trying to send mail through gmail SMTP

The below exception is thrown while trying to send mail by below code: SMPT server requires a secure connection or the client was not authenticated. The server response was 5.5.1. Authentication required C# string E_mail_ID = "hidden"; try …
Jagmeet
  • 11
  • 3
0
votes
1 answer

Handling an WebException in C#

I have this code: public static string HttpGet(string URI) { System.Net.WebRequest req = System.Net.WebRequest.Create(URI); System.Net.WebResponse resp = req.GetResponse(); System.IO.StreamReader sr = new…
wingerse
  • 3,670
  • 1
  • 29
  • 61
0
votes
3 answers

Could this code snippet return false despite availability of internet connection

Could this code snippet return false despite availability of internet connection ? private bool ConnectionIsOk() { try { using (var client = new WebClient()) using (var stream =…
Karam Najjar
  • 527
  • 5
  • 21
0
votes
2 answers

WebClient UploadFile The remote server returned an error: (400) Bad Request

Trying to upload an xml file, this particular server is returning an error (exception above). I have tried another url, on another server (https://posttestserver.com/post.php), and the code worked. My co-worker was able to upload the same xml file…
live-love
  • 48,840
  • 22
  • 240
  • 204
0
votes
1 answer

Send a file via HTTP POST UploadFile Error: Could not establish trust relationship for the SSL/TLS secure channel

I am trying to post an XML file to an URL that was given to me: https://54.xx.xx.xxx/mycompany/path using (WebClient client = new WebClient()) { client.UploadFile(url, filePath); } However, I get this error: "The underlying connection was closed:…
live-love
  • 48,840
  • 22
  • 240
  • 204
0
votes
1 answer

calculation compile issue with c# timer

I have a windows form with a label, and a system.net timer called aTimer. The timer is created in an external class like this: // Create a timer with a 3 minute interval. common.aTimer = new System.Timers.Timer(3000); // Hook up the Elapsed event…
Our Man in Bananas
  • 5,809
  • 21
  • 91
  • 148
0
votes
0 answers

Type or namespace FtpWebRequest could not be found in MonoDevelop

I have a C# Windows Forms application on MonoDevelop. I want to upload and download files to an FTP location. While trying to use FtpWebRequest, I get compile error: "type or namespace could not be found. Are you missing a using directive or an…
0
votes
1 answer

IPEndPoint in Windows Phone 8

I am hoping that someone might be able to help me with some huge confusion I am running into. I am working on porting an open source library so that I can use it within Windows Phone 8. The three main areas that I have found which need to be…
Justin Greywolf
  • 650
  • 7
  • 17
0
votes
1 answer

Is WebClient really unavailable to .NET 3.5 CF?

My app targets Windows CE; it uses the Compact Framework I copied over some elsewhere-working code that uses WebClient, but it won't compile, saying, "The type or namespace name 'WebClient' could not be found (are you missing a using directive or an…
0
votes
2 answers

Load an image from web with new thread

I am trying to load an image from a webserver into a pictureBox. To not block the Form untill the picture is loaded i start a new Thread which works on the LoadPicture()-function till all work is done. Everything will be started on a…