title: System.Net.Sockets.SocketException while using webclient
body: <pre><code>string uploadPath = "http://10.126.64.230/home/pi/Videos/";
  WebClient webclient = new WebClient();
  CredentialCache cc = new CredentialCache();
  Uri uri = new Uri("http://10.126.64.230/pi");
  NetworkCredential nc = new NetworkCredential();
  nc.Domain = "root";
  nc.UserName = "pi";
  nc.Password = "posix";
  cc.Add(
      uri,
  "NTLM",
  nc);
  webclient.Credentials = cc;
  //System.Text.Encoding.ASCII.GetString(responseArray);
  bool cntrl = System.IO.File.Exists(uploadPath + this.FuplVideo.FileName);
  
  if (cntrl)
  {
      // fileName = uploadPath + this.FuplVideo.FileName + DateTime.Now.ToString("yyyy-MM-dd HHmmtt") + ext;
      // webclient.UploadFile(uploadPath, "POST", fullFilePath);
  }
  else
  {
      webclient.UploadFile(uploadPath, "POST", fullFilePath);
  }
  </code></pre>
  
  <p>I try to send a file to a machine that connected with LAN. But I try this code with different versions of domain, I got </p>
  
  <blockquote>
    <p>"System.Net.Sockets.SocketException no connection because of target
    machine refused"</p>
  </blockquote>
  
  <p>error every time. What do you suggest me?</p>