1.用InternetConnect建立连接
2.用HttpOpenRequest打开请求
3.用HttpSendRequestEx启动请求发送
4.用InternetWriteFile写入Post数据
5.重复4,直到Post数据完了
6.用InternetEndRequest结束请求

解决方案 »

  1.   

    你是说HTTP协议的POST吗?
    查看一下RFC文档,可能你的数据不符合协议要求。
      

  2.   

    zhq2000:
       您讲的太简单了,能不能有一个例程讲解,因为WinInet API的设置一直是个问题。
       谢谢。
    jiujiejushi:
       我不知道在那里有RFC文档,更不知道讲的内容,能不能给我一个下载地址呢?
       谢谢。
    希望大家都来讨论这个问题。
       
      

  3.   

    posting files to the web --------------------------------------------------------------------------------this article was contributed by sriram. the webpost api allows applications to easily post web pages (files) to any internet web site. the webpost functions can be used to connect to an internet service provider (isp), determine the protocol needed to copy the files, and much more. these functions can display wizards to guide the users throughout the process. this api is easy to implement and powerful. in this code sample i just called "wppost" function and pass the window handle to tell the wizard which window it should return the focus after it completes its job. then i pass null as value to all the other parameters in this function except the last parameter which is the flags. we can give any of the four given flags  value  meaning  
    wpf_first_file_as_default  if this flag is set then take the first file specified in the lppszlocalpaths list as the file that will be shown as the default page.  
    wpf_minimal_ui  skip the wizard pages where the input has been given. if lpszsitename is given then the wizard will not show the page for choosing the site name 
    wpf_no_recursive_post  do not post the files recursively if lppszlocalpaths array points to a directory.  
    wpf_no_wizard  do not display the wizard. this is relevant only if lpszsitename has been created before.  or just give 0 as the value. in this sample code i just gave 0 as the value to this parameter. here i stop my blah blah and lets look at the code. 
    long cpostview::post( )
    {
    long lret; //return value lret = wppost( getsafehwnd(), // handle to the window
    null,  // number of files to be posted, can be null
    null,  // files list, can be null
    null,  // site name count, can be null
    null,  // site name, can be null
    null,  // url count, can be null
    null,  // url name, can be null

    ); // flags return lret;
    }
    this post() function internally calls wppost function. since all the parameters are given null wppost function calls the wizard to post the files to the web. that's it folks. i will update this article soon with more features. if you have better idea or if you find any bugs in this article let me know. updated on may 23 1998