安全有限制的,但是一但创建了fso对象就什么都能做了
解决方案 »
- js获取FORM表单数据,并将它传递到动态页面
- 关于函数中"this"的问题。
- 除了ietester和ie collection 还有什么方式可以运行ie6的?
- document.documentElement为何没有返回html元素呢?我的代码错在何处呢?
- 关于浏览器辨别新帖子
- asp在<SCRIPT LANGUAGE="JavaScript">脚本的function函数里,怎样调用md5函数,,,,,,,,,,请知道者回答!多谢
- ■表单担交数字验证
- FF下获得DIV内对像坐标(DIV有滚动条)
- 如何用JS在JSP中实现多个”标签(tabel)“的显示。
- 如何监控页面上任一元素(html元素)是否完全加载成功?急求
- 简单的confirm问题
- document.write()与write()有什么区别???
function CreateFile()
{
var fso, tf;
fso = new ActiveXObject("Scripting.FileSystemObject");
tf = fso.CreateTextFile("c:\\testfile.txt", true);
// 写一行,并且带有新行字符。
tf.WriteLine("Testing 1, 2, 3.") ;
// 向文件写三个新行字符。
tf.WriteBlankLines(3) ;
// 写一行。
tf.Write ("This is a test.");
tf.Close();
}function ReadFiles()
{
var fso, f1, ts, s;
var ForReading = 1;
fso = new ActiveXObject("Scripting.FileSystemObject");
f1 = fso.CreateTextFile("c:\\testfile.txt", true);
// 写一行。
Response.Write("Writing file <br>");
f1.WriteLine("Hello World");
f1.WriteBlankLines(1);
f1.Close();
// 读取文件的内容。
Response.Write("Reading file <br>");
ts = fso.OpenTextFile("c:\\testfile.txt", ForReading);
s = ts.ReadLine();
Response.Write("File contents = '" + s + "'");
ts.Close();
}
你好!我在用你的代码时,有一个提示说 “Active 控件不安全,建议不要运行”
我不想要这个提示,该怎么办?谢谢!
var fso = new ActiveXObject("Scripting.FileSystemObject")
var fo =fso.OpenTextFile("你的文件",2)
fo.Write("这个是要写入的内容")读取
var fss= fso.OpenTextFile("要读的文件", ForReading);
fs= fss.ReadLine();
Response.Write(fs);