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.
291
questions
0
votes
1
answer
34
views
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....
0
votes
0
answers
32
views
How can i show downloading speed vb.net
I'm making program to download specific file and i want to show download speed to the user
How can i edit this simple code to do that:
Imports System.Net
Public Class Form1
Private WithEvents ...
0
votes
0
answers
24
views
PowerShell copy command fails : invalid credentials error
I'm running a PS script to copy file to a remote server :
$Source = "C:\ListOfNodes.txt"
$Dest = "\\<IP>\C$\somefile.txt"
$Username = ".\admin"
$Password = "...
0
votes
1
answer
132
views
C# How to send a file to webhook and get sent file's link?
Hello im trying upload file to a link and i tried this:
`private void buttonInput_Click(object sender, EventArgs e)
{
try
{
using (WebClient client = new WebClient())
...
0
votes
0
answers
47
views
C# How to upload any file to a fileuploader?
I need upload my file to "https://file.io" and i tried this:
`private void buttonInput_Click(object sender, EventArgs e)
{
using (WebClient client = new WebClient())
{
...
1
vote
3
answers
190
views
How to improve slow DNS with HttpClient?
I have one request for a specific domain that take a really long time to complete : 22 seconds in average. The request itself does not return a lot of data.
var httpClient = new HttpClient(); //...
-1
votes
1
answer
72
views
different ip address generated when using azure link
I have this code on how to get my IP address. Locally the code is running and I got my IP address correctly, but when I run this code using link in azure different ip address is generated.
So for ...
0
votes
0
answers
90
views
Getting socket exception on 127.0.0.1 (error code 10049) C#
{
ipAddress = IPAddress.Parse("127.0.0.1");
remoteEndPoint = new IPEndPoint(ipAddress, portAddress);
socket = new Socket(ipAddress.AddressFamily, SocketType.Stream, ...
0
votes
0
answers
45
views
Trying to receive a message from TcpClient in C#
I am trying to receive a message from TcpClient but I am a beginner in C# and have a problem and I don't have good knowledge on how it exactly works!
So the problem is that when I try to receive the ...
0
votes
0
answers
29
views
HTTP WebResponse - Read data when it is available in the ResponseStream
SO Team,
I have created a Server that sends the JSON string into the TCPClient Stream, This JSON Data will be sent when the user clicks on the Mouse. For Example, for every click of the position ...
0
votes
0
answers
96
views
Byte Stream Parsing in C#
Hi Stack overflow team,
I am creating a client-server Application that from the Server end transmits data via the TCP client using System.Net.
From the Client End, These needs to be acquired and ...
0
votes
0
answers
30
views
System.Net URL call not returning the expected HTML response
I am trying to query a website to scrape some information for my organization, this information is sat behind a login page which for now I am bypassing by logging into the browser using my ...
0
votes
1
answer
129
views
Can you download a file from an HttpContent stream from within a Windows Forms Application?
I recently developed a .NET Web App that downloaded zip files from a certain, set location on our network. I did this by retrieving the content stream and then passing it back to the View by returning ...
0
votes
1
answer
150
views
Decoding and encoding PDF to send through FTP
Hello there fellow programmers!
I have an issue with sending PDF through FTP. I want to copy propely created PDF to FTP directory, unfortunately file i send through has proper size but i cannot open ...
1
vote
1
answer
185
views
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-...
0
votes
0
answers
426
views
C# WebClient: The underlying connection was closed: An unexpected error occurred on a receive
I'm sorry for reposting this question. Just couldn't find an answer that was working for me.
Problem
This error occurs with Louis Vuitton's website but not with for example a specific ebay listing...
&...
1
vote
1
answer
63
views
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 (...
0
votes
0
answers
31
views
Getting VM IP addresses from server physical address
I am using TNS Names to connect to Oracle DB. An entry that is used by application is using failover scenario with 3 DB IP addresses, all virtual.
I am trying to get and display these DB IP addresses ...
-1
votes
1
answer
466
views
How do I add cookies to a webclient? [duplicate]
So I was looking for an answer and everything I've looked for hasn't worked.
I'm using WinForms with .NET Framework 4.8
I'm very confused as to this. Anyone able to help?
Code below is just an example ...
0
votes
1
answer
24
views
System.Web.Http problem affecting communication
It seems like there is a problem with the "System.Net.Http" dll.
I keep getting all kind of errors relating to it:
while trying to restore nuget packages (It seems like the framework can not ...
1
vote
0
answers
33
views
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 ...
0
votes
1
answer
108
views
What values are allowed for the IsMimeMultipartContent subtype parameter
I am working on an image file upload method in Web API 2 and have noticed that the extension method IsMimeMultipartContent can take a string subtype parameter, as documented here:
https://docs....
2
votes
1
answer
174
views
C# .Net Core 3.1: Having difficulty using System.Net.IPAddress byte order swapping
Sorry to ask about what should be a simple thing, but I've been trying to use IPAddress.NetworkToHostOrder and IPAddress.HostToNetworkOrder to no avail. I'm on Windows rig, little endian. Here's tiny ...
-1
votes
1
answer
131
views
WebClient.UploadString appears to be passing a GET when I'm explicitly doing a POST
This is a weird one can I'm not sure what is happening. I have a testing project that calls my api. Recently, it appears that when I'm calling a none https website (ie http), it's changing my verb ...
1
vote
0
answers
101
views
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 ...
0
votes
2
answers
664
views
WebClient SSL Error: "System.Net.WebException: The SLL connection could not be established"
Hi, dear stranger!
I made a console application for my telegram bot. On my laptop it works perfectly, but on my PC which i want to use as a server this code gets an error. I spent the whole day ...
0
votes
1
answer
119
views
No connection could be made because the target machine actively refused it - TCP
I need help with my situation. Erorr is "No connection could be made because the target machine actively refused it" when run client.Connect(). Thank you!
private void btnSend_Click(object sender, ...
0
votes
0
answers
36
views
I Can't Take Data From Net With HtmlAgilityPack throwing NullReferenceExeption Error [duplicate]
I can't do anything using XPath, I don't know why this isn't working? I tried many ways still I ended up with NullReferenceException error. I really need your help :/
You can look at the code full ...
1
vote
0
answers
117
views
What is the relationship between ServicePointManager.DefaultConnectionLimit and system.net connectionManagement maxconnection?
Do these two settings refer to the same limit or seperate limits? (don't fixate on the number, I put that in at random)
System.Net.ServicePointManager.DefaultConnectionLimit = 20;
The above property ...
4
votes
1
answer
702
views
is system.net connectionManagement maxConnection per domain or shared when using wildcard address?
The documentation for the maxconnection configuration value in the system.net connectionManagement section of a config file is confusing me. When you use a wildcard in the address - is that limit per ...
1
vote
2
answers
2k
views
MemoryStream from HttpContent without copying
I m trying to use System.Net.Http for POST requests. I m ok with HTTP response body being in memory but need to obtain MemoryStream for it. One way to do that would be to call HttpContent....
1
vote
0
answers
266
views
C# Is the TcpListener limited to local area network or is something wrong with my code?
I have a problem with my chat app : it doesn't work over the network . I tried port-forwarding and other similar methods. I'm starting to question my code . I'm new to networking so please help me ...
0
votes
0
answers
269
views
System.TypeLoadException : Could not load type System.Net.HttpStatusCode, netstandard, while decoding custom attribute: (null)
The problem occurs between a Xamarin.IOS type project and a .NetStandard2.0 library. I have created a small solution (link here) demonstrating the problem. To achieve this, the Xamarin project uses ...
0
votes
1
answer
870
views
C# Read all response from an HTTP response Windows System.Net.Http
This is my method, an async HTTP POST :
using System; //main data types
using System.Net.Http; //for HTTP client
using System.Threading.Tasks; ...
7
votes
4
answers
1k
views
Using "System.Net.Dns.GetHostEntry()" to get the IP address for a website, will give different results compared to some online IP checker sites
I am working on a c# console application, and inside my console application, i have the following code, to get the IP for a website:-
using System.Net
using System.Web;
using System.IO;
namespace ...
1
vote
0
answers
119
views
Response URL is returning previous Imgur image URL instead of current image URL
I've built a new Unity project that makes use of C# and System.Net to access Imgur's API. I'm able to pull images into my application from anywhere, and I can upload screenshots to Imgur through my ...
0
votes
0
answers
60
views
Twitter Search API returns null Object
I have been using the Tweetinvi library to search tweets(.NET 4.7.2) for my application. Till last week the application worked fine without issues. Recently I have noticed that the application would ...
0
votes
1
answer
71
views
How can I get "How many Network data(Mobile or WiFi) used when I call API in c# desktop application"
How can I get "How many Network data(Mobile or WiFi) used when I call API in c# desktop application"
I want to know How can i get total used data when i call API service
I have done following code:
...
0
votes
0
answers
51
views
Is it possible to get a list of IPEndPoints on a remote pc on my network using c#
As the title suggests, I'd like to know if it's possible to get a list of System.Net.IPEndPoint on a remote server.
I know this can be done on a local machine using ipGlobalProperties....
4
votes
3
answers
5k
views
Unable to fix error "Could not load System.Net.Http, Version=4.2.0.0"
On my production server I get the error:
Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system ...
0
votes
0
answers
574
views
How to diagnose why async TCP System.Net.Socket send (Begin/End Send) not actually sending anything?
I have an HTTP server and client (they are my code both, C#, HttpListener on the server, HttpWebrequest on a client).
Every client makes approx 6 HTTP requests to the server per minute (if all is OK)....
7
votes
1
answer
223
views
Giving an authentication denied message in httplisteners authenticationselectordelegate
I'm currently using the httplistener authenticationselector delegate to do windows auth and ip checking and it's working brilliantly in that it denies and allows exactly the clients it should be.
...
2
votes
1
answer
1k
views
Changing IP address using .net core on Linux
Is there a way to use .net core code to change networking configuration (IP address, mask, default gateway, DNS, DHCP)
On a Linux operating system? (I am using Ubuntu 18.4.2 LTS )
I can use for some ...
1
vote
3
answers
2k
views
"Program does not contain a static 'Main' method suitable for an entry point" when adding async
So I have been fiddling around with Web responses and requests in C# and I received a problem when I tried to run the program. One of the lines of code I had:
var response = await httpClient....
4
votes
1
answer
54
views
Why the downloaded image from localhost using HttpWebRequest corrupted?
The original image(.jpg) file size is 49kb but when after I downloaded it the file size is 87kb and is corrupted. But for text files, it works. What do I need to do for downloading images using ...
0
votes
1
answer
512
views
c# dns.GetHostEntry() not returning valid ip address
I inherited code that makes the call to Dns.GetHostEntry("10.1.12.180") (or by using the dns of the machine) and the IPHostEntry that is returned has a different ip address "10.100.160.18" If I run ...
3
votes
0
answers
1k
views
Could not create SSL/TLS secure channel since partner webservice upgraded using System.Net and client certificate authentication
We have an application that use to call a webservice secured by SSL client certificate. Our partner upgraded their gateway and since this upgrade we are not able to call their web service anymore.
...
0
votes
0
answers
53
views
Fail to detect the language of content input, error 401
Fail to detect the language of the content input.
I've double checked the API key and it's correct.
When I try to detect the language, it appears error 401.
// ***** DETECT LANGUAGE OF TEXT TO ...
1
vote
2
answers
394
views
How do I resolve 302 Error when using HttpClient?
I've created a custom DNN module that uses HTTPClient to send information to an external API. My HttpClient method is as follows:
public static async Task<string> CreatePayerResponse()
{
...
1
vote
2
answers
7k
views
SocketException 'the connected party did not properly respond after a period of time' when connecting to server using public ip (C#)
I'm trying to create a server using C#. Currently, I have two programs, a server and a client both of which work correctly when they are both run on the same computer, the server's TcpListener is ...