|
string URLAuth = "https://technet.rapaport.com/HTTP/Authenticate.aspx";
WebClient webClient = new
WebClient();
NameValueCollection formData =
new NameValueCollection();
formData["Username"] = "myUser";
formData["Password"] = "myPassword";
byte[] responseBytes = webClient.UploadValues(URLAuth,
"POST", formData);
string ResultAuthTicket = Encoding.UTF8.GetString(responseBytes);
webClient.Dispose();
string URL = "http://technet.rapaport.com/HTTP/Upload/Upload.aspx?Method=file&ReplaceAll=false&ticket="
+ ResultAuthTicket;
formData.Clear();
responseBytes = webClient.UploadFile(URL, "POST",
"C:\\test.csv");
string Result = Encoding.UTF8.GetString(responseBytes);
|
|