예제 #1
0
파일: HttpProc.cs 프로젝트: lsyuan/ecms
        /// <summary>
        /// 向指定网址发送mulitpart编码的数据
        /// </summary>
        /// <param name="url">网址</param>
        /// <param name="mulitpartForm">mulitpart form data</param>
        /// <returns></returns>
        public string Post(string url, MultipartForm mulitpartForm)
        {
            HttpWebRequest request = CreateRequest(url, "POST");

            request.ContentType   = mulitpartForm.ContentType;
            request.ContentLength = mulitpartForm.FormData.Length;
            request.KeepAlive     = true;
            PostData(request, mulitpartForm.FormData);
            respHtml = encoding.GetString(GetData(request));
            return(respHtml);
        }
예제 #2
0
 /// <summary>    
 /// 向指定网址发送mulitpart编码的数据    
 /// </summary>    
 /// <param name="url">网址</param>    
 /// <param name="mulitpartForm">mulitpart form data</param>    
 /// <returns></returns>    
 public string Post(string url, MultipartForm mulitpartForm)
 {
     HttpWebRequest request = CreateRequest(url, "POST");
     request.ContentType = mulitpartForm.ContentType;
     request.ContentLength = mulitpartForm.FormData.Length;
     request.KeepAlive = true;
     PostData(request, mulitpartForm.FormData);
     respHtml = encoding.GetString(GetData(request));
     return respHtml;
 }