vbscript中文件回写到服务器上

weimenghuantianshi 2013-01-07 02:27:05
用vbscript创建一个文本文件,test.txt,如何将文件回写到服务器上的某个文件夹下?
我听说用文件流可以回写到服务器上,不过我没有找到相应的函数,希望大家的帮助,非常感谢
目前只能做到,test.txt存到本地上。谢谢!
目前语句如下:
sub Writes

Const ForAppending=8,TristateFalse=0

Set fso= CreateObject("Scripting.FileSystemObject")
fso.CreateTextFile("c:/test" & ".txt") '默认是桌面
set sfile=fso.OpenTextFile("c:/test.txt",ForAppending,TristateFalse)

set val=ActiveDocument.Fields("[QlikView User]").GetPossibleValues
for i=0 to val.Count-1
user=user&val.Item(i).Text
next
sfile.WriteLine "用户为:"&user
set table = ActiveDocument.GetSheetObject( "CH01" )
sfile.WriteLine "明细表的行数为:"&table.GetRowCount-1 '把表头去掉
sfile.WriteLine "明细表"
CellRect = ActiveDocument.GetApplication().GetEmptyRect()
CellRect.Top = 0
CellRect.Left = 0
CellRect.Width = table.GetColumnCount
CellRect.Height = table.GetRowCount
set CellMatrix = table.GetCells( CellRect )
set CellMatrix = table.GetCells( CellRect )
for RowIter=CellRect.Top to CellRect.Height-1
for ColIter=CellRect.Left to CellRect.Width-1
sfile.Write CellMatrix(RowIter)(ColIter).Text&" "
next
sfile.WriteLine "" '换行
next
sfile.Close
set fso=Nothing
set sfile=Nothing
end sub
...全文
94 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

1,502

社区成员

发帖
与我相关
我的任务
社区描述
VB 网络编程
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧