Why i'm getting PingException? - c#

It was all working an hour ago and many days ago.
The link i try to ping is:
Link to ping
This is the code in form1:
nc = new NetworkConnection();
bool bval = nc.PingConnection(satellite_address);
if (bval)
{
label19.Visible = true;
label19.Text = "Internet Access";
}
else
{
label19.Visible = true;
label19.Text = "No Internet Access";
}
When it's trying to execute this line:
bool bval = nc.PingConnection(satellite_address);
It's going to the nc class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.NetworkInformation;
using System.IO;
using System.Windows.Forms;
namespace mws
{
class NetworkConnection
{
public NetworkConnection()
{
}
public bool PingConnection(string url)
{
bool Result = false;
using (Ping pp = new Ping())
{
byte[] buffer = Encoding.ASCII.GetBytes("samplestring");
int timeout = 120;
try
{
PingReply reply = pp.Send(url, timeout, buffer);
if (reply.Status == IPStatus.Success)
Result = true;
}
catch (Exception)
{
Result = false;
}
}
return Result;
}
}
}
In the nc class when trying to do the line:
PingReply reply = pp.Send(url, timeout, buffer);
It's jumping to the catch block and throws a PingException:
An exception occurred during a Ping request
And then in Form1 the result it return is that there is no internet access but there is internet and I can surf to the url no problems.
This is the complete exception message:
System.Net.NetworkInformation.PingException was caught
HResult=-2146233079
Message=An exception occurred during a Ping request.
Source=System
StackTrace:
at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)
at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer)
at mws.NetworkConnection.PingConnection(String url) in d:\C-Sharp\Download File\Downloading-File-Project-Version-012\Downloading File\NetworkConnection.cs:line 33
InnerException: System.Net.Sockets.SocketException
HResult=-2147467259
Message=No such host is known
Source=System
ErrorCode=11001
NativeErrorCode=11001
StackTrace:
at System.Net.Dns.GetAddrInfo(String name)
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options)
InnerException:
Line 33 is:
PingReply reply = pp.Send(url, timeout, buffer);
What could be the reason that this exception show up ? it didn't show up before ever my program is working for some yeras now.
And what or how should i handle it ?

You cannot pass a full URL to the Send method of the Ping class. The parameter string hostNameOrAddress needs to be
A String that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address.
So you can only pass in www.sat24.com or the IP of the host 82.94.176.100 (taken from the CommandLine ping www.sat24.com).
If you want to pass a full URL to your method you need to extract the Host from that URL to perform your Ping. For this case you can take the Uri class
Uri uri = new Uri(url);
PingReply reply = pp.Send(uri.Host, timeout, buffer);

PingReply reply = pp.Send(url, timeout, buffer);
"No such host is known"
My bet is that no such host is known.
You should ping "www.sat24.com" not "http://www.sat24.com/..."
Ping.Send doesn't say it accepts a URL
public PingReply Send(
string hostNameOrAddress,
int timeout,
byte[] buffer
)
hostNameOrAddress A String that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address.
http://msdn.microsoft.com/en-us/library/ms144954(v=vs.110).aspx

Related

Server Timeout C#

So, I'm developing a client-side application in C# that connects to a server side application (also written in C#). To begin with, I am just trying to get the applications to successfully communicate with one another. Currently, I have both the client and server running on the same device.
Server Side
On the server side, I'm using a TcpListener to accept a socket, printing out that it has connected for debugging purposes, receiving a request, and sending a response. The code can be found below:
Server Side Code:
while (true)
{
// Accept a new connection
Socket socket = socketListener.AcceptSocket();
if (socket.Connected)
{
Console.WriteLine("\nClient Connected!!\n==================\nClient IP {0}\n", socket.RemoteEndPoint);
// Make a byte array and receive data from the client
byte[] receive = new byte[1024];
_ = socket.Receive(receive, receive.Length, 0);
// Convert byte to string
string buffer = Encoding.ASCII.GetString(receive);
string response = "Test response";
int numBytes = 0;
try
{
if (socket.Connected)
{
if ((numBytes = socket.Send(data, data.Length, 0)) == -1)
Console.WriteLine("Socket Error: cannot send packet");
else
Console.WriteLine("No. of bytes sent {0}", numBytes);
}
else
{
Console.WriteLine("Connection Dropped...");
}
}
catch (Exception e)
{
Console.WriteLine("An exception has occurred: " + e.ToString());
}
}
}
Client Side
On the client side, I'm using a TcpClient to connect to the server using an IP address (In this case it's 127.0.0.1), establishing a NetworkStream object, sending a request, and reading a response.
Client-Side Code:
private static readonly TcpClient socket = new TcpClient();
private const string IP = "127.0.0.1";
private const int PORT = 46495;
static void Main(string[] args)
{
try
{
socket.Connect(IP, PORT);
}
catch (Exception)
{
Console.WriteLine("Error connecting to the server.");
return;
}
NetworkStream stream = socket.GetStream();
stream.ReadTimeout = 2000;
string request = "Test Request";
byte[] bytes = Encoding.UTF8.GetBytes(request);
stream.Write(bytes, 0, bytes.Length);
StreamReader reader = new StreamReader(stream, Encoding.UTF8);
try
{
string response = reader.ReadToEnd();
Console.WriteLine(response);
}
catch(Exception e)
{
Console.WriteLine(e);
}
}
The Output
On the server side, everything appears to be fine. The client connects successfully with the expected IP address, I get the expected request, and the correct response appears to have been sent successfully.
The client-side is where it gets more complicated. Where I would expect the "Test Response" response, instead I get a SocketException that from what I understand indicates a timeout??? The full output can be found below:
System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or an established connection failed because the connected host has failed to respond...
---> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or an established connection failed because the connected host has failed to respond.
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.StreamReader.ReadBuffer()
at System.IO.StreamReader.ReadToEnd()
at Client.Client.Main(String[] args) in C:\Dev\Project Orange Sunshine\Project Orange Sunshine\Client\Client.cs:line 38
What I have tried
To begin I wanted to ensure that my server was in fact sending a response in the first place. To test this, I tried accessing the server application through a web browser. Sure enough, I got a blank page with the expected "Test Response" text in the top left corner. This, to me, indicates my server application is working as expected.
Through some googling, I have found a variety of answers to similar questions stating that it is likely that the Windows Defender Firewall is blocking the port that is being used. For testing purposes, I tried disabling the firewall entirely for private networks such as the one that I am on. This didn't change anything, unfortunately.
I feel like I am missing something obvious and any input would be greatly appreciated.
Cheers!
StreamReader.ReadToEnd() on a NetworkStream will only return once the "end" of the stream is reached, which doesn't happen in your example; thus, the StreamReader times out.
You should fix this by using the lower-level NetworkStream.Read method to read from the stream:
var buffer = new byte[4096];
var bytesRead = stream.Read(buffer, 0, buffer.Length);
Console.WriteLine("Read {0} bytes", bytesRead);
string response = Encoding.UTF8.GetString(buffer, 0, bytesRead);
Console.WriteLine(response);
To make this test program more robust, you will also need to introduce "framing", i.e., some way for the server to indicate to the client that it can stop reading. This can be a terminator suffix, such as \r\n used by HTTP, or a length prefix that is sent upfront to tell the client how many more bytes to read.

C# SQL Server CLR Request error on functions GET and POST

I followed the GitHub documentation to implement the http requests with the CURL extension, work in SQL Server 2008 R2, Visual Studio 2010 and .NET 3.5.
I managed to compile and sign correctly the .dll in visual studio, to then create the schemas and functions in SQL Server, since everything works correctly, I can perform GET and POST from SQL Server, however, when wanting to perform a GET or a POST at SABA API, it generates a series of errors.
A .NET Framework error occurred during execution of user-defined
routine or aggregate "XGET": System.Net.WebException: The underlying
connection was closed: An unexpected error occurred on a send. --->
System.IO.IOException: Received an unexpected EOF or 0 bytes from the
transport stream. System.IO.IOException: at
System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset,
Int32 count) at System.Net.Security.SslState.StartReadFrame(Byte[]
buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at
System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer,
AsyncProtocolRequest asyncRequest) at
System.Net.Security.SslState.CheckCompletionBeforatextReceive(ProtocolTokat
message, AsyncProtocolRequest asyncRequest) at
System.Net.Security.SslState.StartSatdBlob(Byte[] incoming, Int32
count, AsyncProtocolRequest asyncRequest) at
System.Net.Security.SslState.ForceAuthattication(Boolean receiveFirst,
Byte[] buffer, AsyncProtocolRequest asyncRequest) at
System.Net.Security.SslState.ProcessAuthattication(LazyAsyncResult
lazyResult) at
System.Net.TlsStream.CallProcessAuthattication(Object state) at
System.Threading.ExecutionContext.runTryCode(Object userData) at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData) at
System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Net.TlsStream.ProcessAuthattication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32
size) at System.Net.ConnectStream.WriteHeaders(Boo ...
System.Net.WebException: at
System.Net.WebCliatt.DownloadDataInternal(Uri address, WebRequest&
request) at System.Net.WebCliatt.DownloadString(Uri address) ...
This is the code of the Assembly
using Microsoft.SqlServer.Server;
using System;
using System.Data.SqlTypes;
using System.Net;
using System.Threading;
public static class Curl
{
[SqlFunction]
[return: SqlFacet(MaxSize = -1)]
public static SqlChars Get(SqlChars H, SqlChars url)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
var client = new WebClient();
AddHeader(H, client);
return new SqlChars(
client.DownloadString(
Uri.EscapeUriString(url.ToSqlString().Value)
).ToCharArray());
}
[SqlProcedure]
public static void Post(SqlChars H, SqlChars d, SqlChars url)
{
var client = new WebClient();
AddHeader(H, client);
if (d.IsNull)
throw new ArgumentException("You must specify data that will be sent to the endpoint", "#d");
var response =
client.UploadString(
Uri.EscapeUriString(url.ToSqlString().Value),
d.ToSqlString().Value
);
SqlContext.Pipe.Send("Request is executed. " + response);
}
[SqlProcedure]
public static void PostWithRetry(SqlChars H, SqlChars d, SqlChars url)
{
var client = new WebClient();
AddHeader(H, client);
if (d.IsNull)
throw new ArgumentException("You must specify data that will be sent to the endpoint", "#d");
int i = RETRY_COUNT;
string response = "";
do try
{
response =
client.UploadString(
Uri.EscapeUriString(url.ToSqlString().Value),
d.ToSqlString().Value
);
i = -1;
break;
}
catch (Exception ex)
{
SqlContext.Pipe.Send("Error:\t" + ex.Message + ". Waiting " + DELAY_ON_ERROR + "ms.");
i--;
Thread.Sleep(DELAY_ON_ERROR);
}
while (i > 0);
if (i == -1)
SqlContext.Pipe.Send("Request is executed." + response);
}
static readonly int RETRY_COUNT = 3;
static readonly int DELAY_ON_ERROR = 50;
public static bool IsNullOrWhiteSpace(this string theString)
{
if (theString == null)
{
return false;
}
if (theString.Trim() == string.Empty)
{
return false;
}
return true;
}
private static void AddHeader(SqlChars H, WebClient client)
{
if (!H.IsNull)
{
string header = H.ToString();
if (!IsNullOrWhiteSpace(header))
client.Headers.Add(HttpRequestHeader.UserAgent, header);
}
}
};
And this how to use in SQL Query
declare #hkey nvarchar(4000) = 'SabaCertificate: 31336132353061666330315E235E756F6E6555E6261536974655E235E656E5F55535E235E536162615E235E24414021463393C69358BE384802BA1BBEAD3B4661862F193021435F7E28A30F7540FE661B9C5F30FDB06C';
declare #endpoint nvarchar(1000) = 'https://libertad-api.sabacloud.com/v1/location?count=10&startPage=1';
select curl.xget(#hkey, #endpoint)
I already test it in PostMan, entering the Header of SabaCertificate, and if it throws a result at me, however, when the certificate is not correct it also throws a response and it is not shown.
Bad Request Example:
{"errorCode":123,"errorMessage":"Invalid or expired Certificate"}
But it also does not give me the answer of the certificate error, that I have to change in my WebClient for this to work.
Added to this I think the certificate is too big because sometimes I get this error:
The identifier that starts with 'SabaCertificate:
31336132353061666330315E235E756F6E6555E6261536974655E235E656E5F55535E235E536162615E235E24414021463393C69358BE384802BA1BBEAD3B4661862F193021435F7E28A30F7540FE661B9C5F30FDB06C'
is too long. Maximum length is 128.
One definite problem in the code is a slight change you made to the original code. In your AddHeader method you have the following line:
client.Headers.Add(HttpRequestHeader.UserAgent, header);
You need to remove the HttpRequestHeader.UserAgent because the code is now creating a "UserAgent" header with a value of whatever you pass in, which is "SabaCertificate: 31336132....".
You will also need to change the security protocols that you are setting as they are not correct. You should try:
ServicePointManager.SecurityProtocol |= (SecurityProtocolType)3072; // TLS 1.2
Since you are using .NET 3.5 via SQL Server 2008 R2, you cannot specify SecurityProtocolType.Tls12 since that value had not yet been added to the enum in Framework Version 3.5, so you have to use the numeric value as shown above. Please keep in mind that the actual ability to do the security protocol is a function of the underlying OS, so it is possible that an older version of Windows / Windows Server does not support TLS 1.2, or might need a registry setting changed in order to do so. You will have to play around with that if you continue to get similar errors from System.Net.TlsStream.
Also, the following error:
The identifier that starts with 'SabaCertificate: 31336...30FDB06C' is too long. Maximum length is 128.
is from user-error. An "identifier" is an item name within SQL Server (objects, Logins, variables, etc). This means that you are doing something different (and wrong) when that error happens, but I can't see how it could be coming from your code, at least not the Get method, as that has no internal interaction with the database.

SmtpClient "Unable to read data from transport connection" only happens after x amount of emails are sent

Edit: Things I have tried
On the server running smtp in smpt virtual server I have set IP
address to specific IP and to "all unassigned", in the Access tab of
SMTP Virtual Service, under relay tab, I have added all the IPs to
grant list along with 127.0.0.1
client.ServicePoint.MaxIdleTime = 100;
moved the using (creating of client) to inside of the for loop
Still same problem, 300 seems to be the magic number before it craps out
I have a very extremely weird problem that I have been trying to solve for past week. My task is simple, "send bulk mail", so I created a very simple exe that will send bunch of emails to a gmail account.
After about sending 280, the sending fails with the following error: I have tried both port 587 and 25 and the problem happens on both ports
System.Net.Mail.SmtpException: Failure sending mail. --->
System.IO.IOException: Unable to read data from the transport connection:
net_io_connectionclosed.
at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32
offset, Int32 read, Boolean readLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller,
Boolean oneLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
--- End of inner exception stack trace ---
at System.Net.Mail.SmtpClient.Send(MailMessage message)
Now I will note that if i run the exe again RIGHT after it fails and i try to send ONE email, i get the same error so the issue does not seem to be a coding issue. This is being sent on VPS running windows 2016 and SmarterMail 16 smtp server.
If i wait about an hour and try to send again, i can successfully send another 280. It seems there is some sort of throttling happening somewhere (I already turned off all the throttlings in SmarterMail).
What is weird is, right after it fails, if i use a service like https://www.smtper.net/ and use the same exact settings as i am using in my exe, then the email goes through with out any errors. I am not sure if this is a smtp error, some setting on windows 2016 that wont allow more than x an hour etc.
Below is my actual exe code, as you can see its extremely simple example
static void Main(string[] args)
{
Console.WriteLine("How many emails do you want to send?");
var emailCount = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("How many seconds do you want to delay between each send");
var delay = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("What email address do you want to send to");
var toEmailAddress = Console.ReadLine();
Console.WriteLine($"Sending out {emailCount} with {delay} second delay to {toEmailAddress}");
using (var client = new SmtpClient(ConfigurationManager.AppSettings["SmtpServer"]))
{
for (int i = 1; i <= emailCount; i++)
{
try
{
var body = "this is a test message";
var userName = ConfigurationManager.AppSettings["Username"];
var password = ConfigurationManager.AppSettings["Password"];
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential(userName, password);
client.Port = Convert.ToInt32(ConfigurationManager.AppSettings["Port"]);
//client.EnableSsl = true;
MailMessage mailMessage = new MailMessage();
mailMessage.From = new MailAddress(ConfigurationManager.AppSettings["FromEmail"]);
mailMessage.To.Add(toEmailAddress);
mailMessage.Body = body;
mailMessage.IsBodyHtml = true;
mailMessage.Subject = ConfigurationManager.AppSettings["Subject"];
client.Send(mailMessage);
if (delay > 0)
{
Console.WriteLine("Sleeping...");
Thread.Sleep(delay * 1000);
}
Console.WriteLine($"Email number {i} was sent successfully.");
}
catch (Exception ex)
{
Console.WriteLine($"Failed to send {i} of {emailCount}");
Console.WriteLine(ex.ToString());
}
}
}
Console.WriteLine("Done...press any key to exit");
Console.ReadKey();
}

C# FTP ListDirectoryDetails Problem

I try to read file list from FTP from direcotry that contains over 1000 files.
I do it like this :
public static FtpWebRequest GetRequest(string uri)
{
FtpWebRequest req = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
req.Credentials = new NetworkCredential("login", "password");
req.KeepAlive = false;
req.UseBinary = false;
req.UsePassive = true;
return req;
}
public static bool CheckConnection()
{
FtpWebResponse respSize = null;
try
{
FtpWebRequest reqFTP = GetRequest(#"ftp://myftp.com");
reqFTP.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
respSize = (FtpWebResponse)reqFTP.GetResponse();
respSize.Close();
respSize = null;
reqFTP.GetResponse().Close();
return true;
}
catch (Exception ex)
{
//...
}
finally
{
if (respSize != null)
respSize.Close();
}
return false;
}
I get an error:
The remote server returned an error:
(451) Local error in processing.
at
System.Net.FtpWebRequest.SyncRequestCallback(Object
obj)
at
System.Net.FtpWebRequest.RequestCallback(Object
obj)
at
System.Net.CommandStream.Dispose(Boolean
disposing)
at System.IO.Stream.Close()
at System.IO.Stream.Dispose()
at
System.Net.ConnectionPool.Destroy(PooledStream
pooledStream)
at
System.Net.ConnectionPool.PutConnection(PooledStream
pooledStream, Object owningObject,
Int32 creationTimeout, Boolean
canReuse)
at
System.Net.FtpWebRequest.FinishRequestStage(RequestStage
stage)
at
System.Net.FtpWebRequest.SyncRequestCallback(Object
obj)
at
System.Net.FtpWebRequest.RequestCallback(Object
obj)
at
System.Net.CommandStream.Abort(Exception
e)
at
System.Net.CommandStream.CheckContinuePipeline()
at
System.Net.FtpWebRequest.DataStreamClosed(CloseExState
closeState)
at
System.Net.FtpDataStream.System.Net.ICloseEx.CloseEx(CloseExState
closeState)
at
System.Net.FtpDataStream.Dispose(Boolean
disposing)
at System.IO.Stream.Close()
at
System.Net.FtpWebResponse.Close()
at CheckConnection()
does anyone knows what is going on ?
regards
Marcin
From RhinoSoft (makers of the FTP software Serv-U):
"A 451 reply code may be sent in response to any command initiating a file transfer. It is a transient negative response, which means the error condition is a temporary one. It is usually sent in response to the server encountering an unexpected local error when processing data it is transferring or receiving. In this case, the client is encouraged to restart the FTP transaction and try again." [1]
So, it may be an issue with communication between your software and the FTP server, not necessarily an issue with your software itself.
It can't hurt to increase the length of the Timeout property of FtpWebRequest, but that's not likely to be the cause based on my research.

file upload error

Here is my code at both client side and server side. My code is simple, just upload a file to an ASP.Net web site.
My client code throws exception when it works on Vista (x64, Enterprise, SP1), but works fine on Windows Server 2003.
Any ideas?
10.10.12.162 is my server address.
[Code]
Client:
static void Main(string[] args)
{
Console.Write("\nPlease enter the URI to post data to : ");
String uriString = Console.ReadLine();
WebClient myWebClient = new WebClient();
Console.WriteLine("\nPlease enter the fully qualified path of the file to be uploaded to the URI");
string fileName = Console.ReadLine();
Console.WriteLine("Uploading {0} to {1} ...", fileName, uriString);
DateTime begin = DateTime.Now;
byte[] responseArray = null;
try
{
responseArray = myWebClient.UploadFile(uriString, fileName);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.ToString());
}
DateTime end = DateTime.Now;
Console.WriteLine("Elapsed time is: {0}", (end - begin).TotalMilliseconds);
}
Server:
public partial class FileUploadHandler : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
foreach (string f in Request.Files.AllKeys)
{
HttpPostedFile file = Request.Files[f];
file.SaveAs("D:\\UploadFile\\UploadedFiles\\" + file.FileName);
}
}
}
Exception from client side:
Unable to connect to the remote server
System.Net.WebException: Unable to connect to the remote server ---> System.Net.
Sockets.SocketException: No connection could be made because the target machine
actively refused it 10.10.12.162:1031
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddre
ss socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Sock
et s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state,
IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.WebClient.UploadFile(Uri address, String method, String fileNam
e)
at FileUploadClient.Program.Main(String[] args) in D:\UploadFile\FileUploadClient\Program.cs:line 30
[/Code]
regards,
George
There's nothing about that code which would alarm me too much.
Open a remote desktop on the machine that is causing you problems.
Open a command line.
Issue the command:
telnet 10.10.12.162 1031
Do you see a cursor, or does telnet give you an error that it cannot connect? If you get an error from telnet, you probably have a NIC issue/firewall issue/router issue/other connectivity issue unrelated to your code.

Categories

Resources