我正在开发WinForms应用程序,并想向网络应用发送双面图像数据。 如何工作?
我将这一点编成法典:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.AllowWriteStreamBuffering = true;
request.KeepAlive = true;
request.Credentials = System.Net.CredentialCache.DefaultCredentials;
var fc = GetFileContent(varsayilanResimGuid);
byte[] postBytes = fc.Dosya;
request.ContentLength = postBytes.LongLength;
Stream requestStream = request.GetRequestStream();
requestStream.Write(postBytes, 0, postBytes.Length);
requestStream.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
string content = new StreamReader(response.GetResponseStream()).ReadToEnd();
以及我如何以.语接收这种双亲形象内容?