我现在上传提示错误:参数错误然后,问了对方,那人说 upload参数是必须的,我就不知道这个参数是加到哪儿的

解决方案 »

  1.   


    string SendPostRequest(string url, string postString)
        {
            byte[] postData = Encoding.UTF8.GetBytes(postString);
            WebClient client = new WebClient();
            client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
            client.Headers.Add("ContentLength", postData.Length.ToString());
            byte[] responseData = client.UploadData(url, "POST", postData);
            return Encoding.UTF8.GetString(responseData);
        }
    Response.Write(SendPostRequest("http://www.webxml.com.cn/WebServices/WeatherWebService.asmx/getSupportCity", "byProvinceName=辽宁"));
    看下这个  这是请求服务 参数byProvinceName是辽宁 可以正确post给server 不知道对你有没有帮助..
      

  2.   

    string SendPostRequest(string url, string postString)
        {
            byte[] postData = Encoding.UTF8.GetBytes(upload + postString);
            WebClient client = new WebClient();
            client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
            client.Headers.Add("ContentLength", postData.Length.ToString());
            byte[] responseData = client.UploadData(url, "POST", postData);
            return Encoding.UTF8.GetString(responseData);
        }
    试试
      

  3.   

    string SendPostRequest(string url, string postString)
        {
            byte[] postData = Encoding.UTF8.GetBytes("upload=" + postString);
            WebClient client = new WebClient();
            client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
            client.Headers.Add("ContentLength", postData.Length.ToString());
            byte[] responseData = client.UploadData(url, "POST", postData);
            return Encoding.UTF8.GetString(responseData);
        }
    试试
      

  4.   

    OK,我试试,刚才我问了对方,对方也说 upload 是上传的文件流
      

  5.   

    OK,我试试,刚才我问了对方,对方也说 upload 是上传的文件流结贴给分啊,火火火
      

  6.   

    OK,我试试,刚才我问了对方,对方也说 upload 是上传的文件流结贴给分啊,火火火上传还是不成功,一直提示参数错误