Dictionary
dicForm.Add("DVdevsel", counterNum);
string boundary = "---------------------------" + genBoundary(14);
byte[] data = this.genFormData(dicForm, boundary);
HttpWebRequest myHttpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
myHttpWebRequest.Method = "POST";
myHttpWebRequest.KeepAlive = false;
myHttpWebRequest.ContentType = "multipart/form-data; boundary=" + boundary;
myHttpWebRequest.ContentLength = data.Length;
Stream requestStream = myHttpWebRequest.GetRequestStream();
requestStream.Write(data, 0, data.Length);
requestStream.Close();
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
Stream responseStream = myHttpWebResponse.GetResponseStream();
StreamReader myStreamReader = new StreamReader(responseStream, Encoding.Default);
string pageContent = myStreamReader.ReadToEnd();
myStreamReader.Close();
responseStream.Close();
myHttpWebResponse.Close();
Replies
Know the answer? Post it — somebody with the same question will find it here.