在WinForm中通过HTTP协议向服务器端上传文件(5) text2 = this.m_headers["Content-Type"]; if (text2 != null) { if (text2.ToLower(CultureInfo.InvariantCulture).StartsWith("multipart/")) { throw new WebException(SR.GetString("net_webclient_Multipart")); } } else { text2 = "application/octet-stream"; } this.m_headers["Content-Type"] = "multipart/form-data; boundary=" + text1; this.m_responseHeaders = null; stream1 = new FileStream(fileName, FileMode.Open, FileAccess.Read); request1 = WebRequest.Create(this.GetUri(address)); request1.Credentials = this.Credentials;