最近写了一个反弹木马,利用了www.weesky.com/111.txt来做中转。读取这个txt的时候我使用WebBrowser1控件来读取。用
Text1.Text = WebBrowser1.Document.All(i).innerText 来实现。速度很快。现在的问题是:我不知道如何向www.weesky.com/111.txt中快速写入文字。(要快速!)不要Ftp上传一个111.txt覆盖。
不知各位大侠可有好的方法。请您指点。非常感谢!
(另外,如果有更快的显示 /111.txt中内容的方法,也请您指点。^_^ )
Text1.Text = WebBrowser1.Document.All(i).innerText 来实现。速度很快。现在的问题是:我不知道如何向www.weesky.com/111.txt中快速写入文字。(要快速!)不要Ftp上传一个111.txt覆盖。
不知各位大侠可有好的方法。请您指点。非常感谢!
(另外,如果有更快的显示 /111.txt中内容的方法,也请您指点。^_^ )
那么使用asp读写111.txt文件
速度绝对快
使用webbrowser控件
Private Sub Form_Load()
WebBrowser1.Navigate "http://www.xxx.net/file.asp"
End Sub
<%
Set fs = Server.CreateObject("Scripting.FileSystemObject")
File = Server.MapPath( "Sample.txt" )
Set txtf = fs.OpenTextFile( File )
If Not txtf.atEndOfStream Then ' 先确定还没有到达结尾的位置
Content = txtf.ReadAll ' 读取整个文件的信息
Lines = Replace(Content, vbCrLf, "<BR>" )
Response.Write Lines
End if
%>
<%
Set fs = Server.CreateObject("Scripting.FileSystemObject")
File = Server.MapPath( "Sample.txt" )
Set txtf = fs.OpenTextFile( File )
If Not txtf.atEndOfStream Then ' 先确定还没有到达结尾的位置
Content = txtf.ReadAll ' 读取整个文件的信息
End If
%><HTML><BODY><H2>Sample.txt 编辑网页<HR></H2>
<FORM Action=EditDsp2.asp Method=POST>
<TEXTAREA Rows=10 Cols=60 Name=Sample><%=Content%></TEXTAREA><P>
<INPUT Type=Submit Value=" 提交"></FORM>
</BODY></HTML>
<%
Content = Request("Sample")
Set fs = Server.CreateObject("Scripting.FileSystemObject")
File = Server.MapPath( "Sample.txt" )
Set txtf = fs.OpenTextFile( File, 2, True )
txtf.Write Content
Content = Replace( Content, vbCrLf, "<BR>" )
%>
<HTML><BODY><H2>Sample.txt 编辑后的内容<HR></H2><%=Content%>#015: </BODY></HTML>
使用FSO对象,和访问本地文件没有什么区别
用Microsoft Scripting Runtime
Option Explicit
Dim FSO As New FileSystemObject
Private Sub Form_Load()
dim f
set f=FSO.OpenTextFile("\\www.weeksky.com\\file",forreading)
text1.text=f.readall
f.close
nd sub
我再试试看。Thanks 2位仁兄。
不知您说的“把要写得内容作为asp的参数传递过去”,不知道您是怎样做的。龙卷风兄:
Set f = FSO.OpenTextFile("\\www.weesky.com\\111.txt", forreading) 始终告诉我文件没有找到。晕死。
可是我还是不太明白,和程序的要求仍然不符啊
<FORM Action=EditDsp2.asp Method=POST>
就是这种提交到editdsp.asp,然后这个文件作处理试试
Set f = FSO.OpenTextFile("\\www.weesky.com\111.txt", forreading,-2)
Set f = FSO.OpenTextFile("\\192.168.0.1\111.txt", forreading,-2)
我建议你先把asp程序运行一下,熟悉熟悉看看怎样提交的
Option Explicit
Dim FSO As New FileSystemObject
Private Sub Form_Load()
Dim f
Set f = FSO.OpenTextFile("\\www.weesky.com\Sample.txt", forreading, -2)
Text1.Text = f.readall
f.Close
End Sub
仍然出错,文件未发现。您试试看。
顺便贴一些代码,整理一下
Option Explicit
Dim FSO As New FileSystemObject
Private Sub Form_Load()
Dim f
Set f = FSO.OpenTextFile("\\www.weesky.com\Sample.txt", forreading, -2)
Text1.Text = f.readall
f.Close
End Sub
仍然出错,文件未发现。您试试看。
而 Set f = FSO.OpenTextFile("c:\222.txt", forreading, -2) 就没问题,不知道我哪里写错了
这是文件内容
adsf33434555
Dim FSO As New FileSystemObject
Private Sub Form_Load()
Dim f
Set f = FSO.OpenTextFile("\\www.weesky.com\Sample.txt", forreading, -2)
Text1.Text = f.readall
f.Close
End Sub
哦??不会吧哥哥。可是我这里却是报Path not found 啊!