首页 新闻 会员 周边

请帮忙翻译成 c#.net,谢谢!!着急哦!!

0
悬赏园豆:20 [已关闭问题]

<%@ 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
%>

问题补充: 忘记了讲了,这个是asp版本的
crocodile的主页 crocodile | 初学一级 | 园豆:80
提问于:2009-01-05 23:02
< >
分享
其他回答(1)
0

其它地方没什么翻译的,可能就这个地方有些特殊

Set XX=CreateObject("Adodb.stream")
你需要在C#中把Adodb.stream引入生成代理类完成对于Adodb.stream的使用。

GUO Xingwang | 园豆:3885 (老鸟四级) | 2009-01-06 09:06
0

不就是个文件上传吗,C#里面没有那么麻烦~~~弄个File控件就好了.

沙加 | 园豆:3680 (老鸟四级) | 2009-01-06 10:01
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册