我在自己电脑上试的.应该不用设什么权限吧,   报..什么 [...Object不能做成...]

解决方案 »

  1.   

    @fso = new ActiveXObject("Scripting.FileSystemObject");
    出错提示:
          @为出错行列, 
      报错为: Object不能作成.
    我在自己本地测试,应该不要权限吧...
      

  2.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 11.0.0.0 for Windows">
    <META http-equiv="Content-Style-Type" content="text/css">
    <META name="IBM:HPB-Input-Mode" content="mode/flm; pagewidth=940; pageheight=1200">
    <title>Untitled Document</title>
    <script language="javascript" type="text/javascript">
    function init()
    {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(); 
    }
    </script>
    </head>
    <BODY>
    <DIV style="width : 20px;height : 16px;top : 14px;left : 8px;
      position : absolute;
      z-index : 1;
    " id="Layer1"><input name="a" type="button" onClick="init()" value="aa" /></DIV>
    </BODY>
    </HTML>以上是代码不行;以下代码可以:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=shift_jis" />
    <title>Untitled Document</title>
    <script language="javascript" type="text/javascript">
    function init()
    {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(); 
    }
    </script>
    </head><body>
    <input name="a" type="button" onClick="init()" value="aa" />
    </body>
    </html>求解,我想让,上面的代码可以,该怎么做...????
      

  3.   

    把上段代码的第一行换成下面的代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">就OK了.经测试,,成功.给分!!!
      

  4.   

    至于,为什么,我不知道.估计要在这个地址里"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,指定个什么类吧.
    具体的,,静候高手回答,..........
    我不知道.........
      

  5.   

    都可以呀,我把你的两段代码都试了,我的xp,是ie版本不一样!
      

  6.   

    你不用指望在网上的HTML文件可以执行这段代码...
      

  7.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <script type="text/javascript" src="javascript/SendCommand.js"></script>
    <script type="text/javascript" src="javascript/SendPlayCommand.js"></script>
    <META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 11.0.0.0 for Windows">
    <META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <META http-equiv="Content-Style-Type" content="text/css">
    <META name="IBM:HPB-Input-Mode" content="mode/flm; pagewidth=1200; pageheight=2000">
    <TITLE></TITLE>
    <Script Language="JavaScript">
    function init(){var htadText ;htadText = htadText + "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>";
    htadText = htadText + "<HTML>";
    htadText = htadText + "<HEAD>";
    htadText = htadText + "<script type='text/javascript' 
    src='javascript/SendCommand.js'></script>";
    htadText = htadText + "<script type='text/javascript' 
    src='javascript/SendPlayCommand.js'></script>";
    htadText = htadText + "<META name='GENERATOR' content='IBM WebSphere Studio Homepage Builder 
    Version 11.0.0.0 for Windows'>";
    htadText = htadText + "<META http-equiv='Content-Type' content='text/html; 
    charset=Shift_JIS'>";
    htadText = htadText + "<META http-equiv='Content-Style-Type' content='text/css'>";
    htadText = htadText + "<META name='IBM:HPB-Input-Mode' content='mode/flm; pagewidth=1200; 
    pageheight=2000'>";
    htadText = htadText + "<TITLE></TITLE>";
    htadText = htadText + "<BODY>";
    htadText = htadText + innerText;
    htadText = htadText + "</BODY>";
    htadText = htadText + "</HTML>";var fso, tf;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    tf = fso.CreateTextFile("C:\\Design.html", true);
    tf.Write(htadText);
    tf.Close();
    }
    </Script></HEAD>
    <BODY onload="init();">
    <DIV style="top : px;left : px;
      position : absolute;
      z-index : 2;
      width : 732px;
      height : 608px;
      top : 0px;
      left : 8px;
    " id="0">
    </DIV>
    </BODY>
    </HTML>
    以上HTML画面无法正常显示.C:\\Design.html文件也没有做成.   求为什么会这样/去掉
    htadText = htadText + "<script type='text/javascript' 
    src='javascript/SendCommand.js'></script>";
    htadText = htadText + "<script type='text/javascript' 
    src='javascript/SendPlayCommand.js'></script>";这俩行,就正常显示,文件也可以正常做成,,,为什么会这样   要怎么做才OK??
      

  8.   

    chaircat(chaircat) 
    为什么??