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

Stream.read() is very slow

I have the following code for downloading a file. When i am downloading a file with a browser then it is downloading like 1mbps but when i am downloading with my code it is downloading like 200kbps or so. Why is the code downloading slowly? Is it…
Kashif Khan
  • 685
  • 2
  • 11
  • 30
0
votes
3 answers

Why does SmtpClient fail with several different Exceptions when using SSL?

I'm trying to send a mail message using System.Net.Mail.SmtpClient with SSL enabled. While changing no external factors (i.e. hit F5, then hit F5 Again - or even in a loop) it works some times, but most of the times it fails. Example code: public…
Torben Frandsen
  • 89
  • 1
  • 10
0
votes
1 answer

How can I search patterns with regex groups of characters that have the first two letters uppercased?

I am trying to scrap using system.net and regular expressions a web page that looks like in the picture in order to get info like Created By: see the picture! Here is my code so far: String html = web.DownloadString("https://.."); …
Răzvan Bălan
  • 33
  • 1
  • 13
0
votes
1 answer

WebClient.FileDownlOad GIVIn error that the file a is accessed by another process

I am trying to download a file using webclient method DownloadFile But its giving me error that The process cannot access the file '...\d915877c-cb7c-4eeb-97d8-41d49b75aa27.docx' because it is being used by another process. But when I open the…
user786
  • 3,902
  • 4
  • 40
  • 72
0
votes
0 answers

Socket always receive 0 length data after DuplicateAndClose

The purpose to duplicate the socket by calling the DuplicateAndClose method is to accept the socket in main AppDomain but to process it in a separated AppDomain so the process logic can be unloaded & updated without restarting the process. Currently…
Mark Yuan
  • 850
  • 1
  • 8
  • 17
0
votes
2 answers

Why does WebClient.UploadValues overwrites my html web page?

I'm familiar with Winform and WPF, but new to web developing. One day saw WebClient.UploadValues and decided to try it. static void Main(string[] args) { using (var client = new WebClient()) { var values = new NameValueCollection(); …
Lei Yang
  • 3,970
  • 6
  • 38
  • 59
0
votes
0 answers

buffer byte array size for NetworkStream.Read

I'm trying to learn the basics of TCP (and hopefully soon UDP) to make some multi-client applications. I've noticed that every example I've seen has a buffer like so: serverStream = clientSocket.GetStream(); byte[] inStream =…
Dom Hall
  • 53
  • 9
0
votes
0 answers

Select default network interface for Http requests in console app

I use mono to compile and run my C# console application. In that application i do several Http requests. Now i am in trouble with selecting proper network interface for app instance to send requests from. Let's say i have eth0 and eth1 interfaces in…
Croll
  • 3,631
  • 6
  • 30
  • 63
0
votes
0 answers

Get List of All PeerNameRecord's in a Cloud from C# System.Net.PeerToPeer

I would like to know if there is a way to use the System.Net.PeerToPeer namespace in C# to perform a lookup of all System.Net.PeerToPeer.PeerNameRecord's on a System.Net.PeerToPeer.Cloud. Ideally I want to list out everyone registered to the cloud…
Andrew
  • 381
  • 1
  • 7
0
votes
1 answer

defaultProxy.useDefaultCredentials in WCF client programmatically

What code I should write to get same behavior as I set in config file
Sergey Shuvalov
  • 2,098
  • 2
  • 17
  • 21
0
votes
1 answer

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 =…
user389753
  • 153
  • 1
  • 1
  • 4
0
votes
1 answer

C# downloading page returns old page

I have problem, i wrote method to get current song on Czech radio. They do not have API so i had to get song from html via html agility.dll Problem is even though song title changes on page my method downloads old page, usually i have to wait like…
Soolar
  • 676
  • 7
  • 4
0
votes
1 answer

How do I get to the response when I recieve a ServerProtocolViolation exception?

I am trying to make an HttpWebRequest to a remote sensor with an HTML server on it to pull back the data. I think the problem is that the web server has some issue with it. I can get the web page to render in a web browser and the data is visible.…
tnktnk
  • 512
  • 2
  • 7
  • 20
0
votes
0 answers

maxConnection setting being ignored on .NET 4 client

I have .NET 4 code (not ASP) running both on win 7 and server 2008 that creates multiple threads (each with a webclient, as I need separate cookiecontainers) for requests and responses to websites. I use multiple proxies and for each proxy I will…
Mint
  • 84
  • 6
0
votes
2 answers

Edit Web.Config - "System.Net" Section Programmatically?

I want to change the "system.net" section in web.config. I want to add or remove defaultProxy tag according to a variable in runtime.
akdora
  • 893
  • 1
  • 9
  • 19