使用wininet和socket都可以

解决方案 »

  1.   

    给个源代码
    http://www.vcfan.com/vc/down_children.asp?child_name=kongjian_internet
      

  2.   

    参考:
    http://support.microsoft.com/support/kb/articles/Q189/6/51.asp
    The specification in RFC 1867 "Form-based File Upload in HTML" describes the mechanism by which a file may be uploaded from a Web browser to the server. However, to implement this functionality it is necessary to provide of an server application capable of accepting the POST from a client browser. IIS does not accept data posted to the server but passes on the data to the server application which is responsible for appropriately handling the posted data.For those using earlier versions of IIS or wanting functionality beyond just writing the inbound file to disk, the following library is provided as a sample on how to implement the parsing mechanism. Uploadext.exe is a sample ISAPI extension DLL that implements the necessary parsing routines to break up multi-part data forms. This self- extracting executable contains the necessary project files for an ISAPI Extension DLL using Microsoft Visual C++ 5.0. 
    MORE INFORMATION
    For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base: 
    119591 How to Obtain Microsoft Support Files from Online Services Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. There are three ways to upload files to Microsoft Internet Information Server. One is to use the PUT command with the file content (see 184352 in the REFERENCES section below). However, this method requires that the browser supports the PUT command. The second way is to use the POST command with INPUT=FILE for the input type. The mechanism for this is described in detail in RFC 1867. Internet Explorer 3.02 with File Upload Add-on, Internet Explorer 4.x, and Netscape Navigator 4.x support this method. The third way is to use the Web Publishing Wizard. See documentation at the following Web site: 
    http://www.microsoft.com/downloads/release.asp?ReleaseID=22658The sample library attached to this article shows how you can implement a similar functionality with ISAPI Extensions. The sample extension will parse out the multi-part data and write to the disk the contents of each part (using the name of the multipart as the file name). The sample and the classes within the sample makes use of various Standard Template Library (STL) containers. Refer to the Visual C++ 5.0's online documentation regarding STLs. To test the sample, simply extract the files to a directory, start Visual C++, load the project file (.dsw), and build the .DLL. Once that's accomplished, copy the DLL to the /scripts/ directory of a Web server and the Upload.html file to the /wwwroot/ directory of the same Web server (you may need to edit the Upload.html if you are not using the default paths for IIS). Using either browser supporting "INTPUT=FILE" tag, request the Upload.html from the Web server. Fill out the form and submit the request. If you did not change the source code of the sample DLL, the uploaded files will appear in C:\Temp\. 
      

  3.   

    thanks,能不能在后台实现的,不用出现界面