<%@ LANGUAGE="VBSCRIPT" %>
<%
'Increase Script Timeout to 10 hours
'Const ForWriting = 2
'Dim fso, f
'Set fso = CreateObject("Scripting.FileSystemObject")
'Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
dim XX
Set XX=CreateObject("Adodb.stream")
XX.Type = 1
header = Request.ServerVariables("HTTP_USER_AGENT")
pathinfo = Request.ServerVariables("PATH_INFO")
Request.Form("");
tmp = Server.MapPath("/test1") & "\" & header
Server_name = Request.ServerVariables("SERVER_NAME")
Server_port = Request.ServerVariables("SERVER_PORT")
urladdr = "http://" & Server_name & ":" & Server_port & "/test1/" & header
'dim path = Server.MapPath("/"
Server.ScriptTimeout = 36000
'Get size of POST data
PostSize = Request.TotalBytes
'Read POST data in 1K chunks
BytesRead = 0
For i = 1 to (PostSize/1024)
ReadSize=1024
PostData = Request.BinaryRead(ReadSize)
XX.Write PostData
BytesRead = BytesRead + ReadSize
Next
'Read remaining fraction of 1K
ReadSize=PostSize - BytesRead
If ReadSize <> 0 Then
PostData = Request.BinaryRead(ReadSize)
XX.Write PostData
BytesRead = BytesRead + ReadSize
End If
XX.SaveToFile tmp, 2
XX.Close
' Send results back to client
'Response.Write BytesRead
'Response.Write " bytes were read."
Response.Write urladdr
%>
其它地方没什么翻译的,可能就这个地方有些特殊
Set XX=CreateObject("Adodb.stream")
你需要在C#中把Adodb.stream引入生成代理类完成对于Adodb.stream的使用。
不就是个文件上传吗,C#里面没有那么麻烦~~~弄个File控件就好了.