** ? concerning CreateObject("Scripting.FileSystemObject") 
Author Message
 ** ? concerning CreateObject("Scripting.FileSystemObject")

Hi doe anyone know how to call the
CreateObject("Scripting.FileSystemObject"), in asp
other then in the primary scripting <%   %> of vb. In the following
example just below I'm trying to read a script file every 5 second ,
this works without the filesystemobject......Anyone know how to
achieve this..

<SCRIPT LANGUAGE="VBScript">

Const ForReading = 1
public x
Public Sub Gpwsm
        Const ForReading = 1
        Set fs = Server.CreateObject("Scripting.FileSystemObject")
        Set a = fs.OpenTextFile("c:\webshare\wwwroot\pwsm.txt",
ForReading, FALSE)
        RawData = a.Read(15)
        a.Close

        x = x + 1
        document.all.MyData.innerText = x & " -- " & time
        MyID = setTimeout ("Gpwsm", 5000)

End Sub
</script>

<body onLoad="Gpwsm()" background = "white">

<P ID="MyData"></P>

</body>

Thanks
Bandit



Sat, 21 Jun 2003 08:21:51 GMT  
 ** ? concerning CreateObject("Scripting.FileSystemObject")
The FileSystemObject object is considered an "unsafe" component in client
side script...

Using "unsafe" components requires *every* user to lower security for the
appropriate security zone.

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--


Quote:
> Hi doe anyone know how to call the
> CreateObject("Scripting.FileSystemObject"), in asp
> other then in the primary scripting <%   %> of vb. In the following
> example just below I'm trying to read a script file every 5 second ,
> this works without the filesystemobject......Anyone know how to
> achieve this..

> <SCRIPT LANGUAGE="VBScript">

> Const ForReading = 1
> public x
> Public Sub Gpwsm
> Const ForReading = 1
> Set fs = Server.CreateObject("Scripting.FileSystemObject")
> Set a = fs.OpenTextFile("c:\webshare\wwwroot\pwsm.txt",
> ForReading, FALSE)
> RawData = a.Read(15)
> a.Close

>    x = x + 1
>     document.all.MyData.innerText = x & " -- " & time
> MyID = setTimeout ("Gpwsm", 5000)

> End Sub
> </script>

> <body onLoad="Gpwsm()" background = "white">

> <P ID="MyData"></P>

> </body>

> Thanks
> Bandit



Sat, 21 Jun 2003 09:15:55 GMT  
 ** ? concerning CreateObject("Scripting.FileSystemObject")
Hi the real script is running on our intrenet, all user's browser's
are set to low. on W2kAS

the error is
line   5
Char 1
Error  object required
Code 0

which is
public Sub Gpwsm

John



Quote:
>The FileSystemObject object is considered an "unsafe" component in client
>side script...

>Using "unsafe" components requires *every* user to lower security for the
>appropriate security zone.

>--
>Michael Harris
>Microsoft.MVP.Scripting
>--

>Please do not email questions - post them to the newsgroup instead.



Sat, 21 Jun 2003 11:55:26 GMT  
 ** ? concerning CreateObject("Scripting.FileSystemObject")
Hi the real script is running on our intrenet, all user's browser's
are set to low. on W2kAS

the error is
line   5
Char 1
correction from Error  object required to
Error object  expected
Code 0

which is
public Sub Gpwsm

John



Quote:
>The FileSystemObject object is considered an "unsafe" component in client
>side script...

>Using "unsafe" components requires *every* user to lower security for the
>appropriate security zone.

>--
>Michael Harris
>Microsoft.MVP.Scripting
>--

>Please do not email questions - post them to the newsgroup instead.



Sat, 21 Jun 2003 11:58:24 GMT  
 ** ? concerning CreateObject("Scripting.FileSystemObject")

You keep posting client side code that tries to use
Server.CreateObject(...).  On the client side, just use CreateObject(...).

And you MUST use customized settings - the Low setting still disables the
option "Initialize and script ActiveX controls not marked as safe".

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--


Quote:
> Hi the real script is running on our intrenet, all user's browser's
> are set to low. on W2kAS

> the error is
> line   5
> Char 1
> Error  object required
> Code 0

> which is
> public Sub Gpwsm

> John



> >The FileSystemObject object is considered an "unsafe" component in client
> >side script...

> >Using "unsafe" components requires *every* user to lower security for the
> >appropriate security zone.

> >--
> >Michael Harris
> >Microsoft.MVP.Scripting
> >--

> >Please do not email questions - post them to the newsgroup instead.



Sat, 21 Jun 2003 12:10:07 GMT  
 ** ? concerning CreateObject("Scripting.FileSystemObject")
ok my mistake I wrote it up quiclly to the group its not client side
script.... it server side   Its just a test, wanted to know if there
was any way to access any text file , so far I've goten how is the
text file created... which really does not matter this is just a
simple questioon if one can read one's own text file at this time in
the script and update the webpage (Document) at intevals of time
instead of re-outputing the whole page, by updating the tags

<SCRIPT LANGUAGE=vbscript Runat=server
Const ForReading = 1
public x
public Sub Gpwsm()
   'any text file on my system here,  using the filesystemobject
   x = x + 1
    document.all.MyData.innerText = x & " -- " & time
        yID = setTimeout ("Gpwsm", 1000)
End Sub

</SCRIPT>

<body onLoad="Gpwsm()" background = "white">

<P ID="MyData"></P>

</body>

John



Sat, 21 Jun 2003 15:11:24 GMT  
 ** ? concerning CreateObject("Scripting.FileSystemObject")
As I believe I noted in a previous response, I do not think that
browser-side events such as OnLoad can call server-side routines, which your
code below is still trying to do. If you have working (or near working)
code, please post a new cut-and-paste copy. The code below will obviously
fail because of the lack of a ">" on the right end of the first SCRIPT tag.

/Al


Quote:
> ok my mistake I wrote it up quiclly to the group its not client side
> script.... it server side   Its just a test, wanted to know if there
> was any way to access any text file , so far I've goten how is the
> text file created... which really does not matter this is just a
> simple questioon if one can read one's own text file at this time in
> the script and update the webpage (Document) at intevals of time
> instead of re-outputing the whole page, by updating the tags

> <SCRIPT LANGUAGE=vbscript Runat=server
> Const ForReading = 1
> public x
> public Sub Gpwsm()
>    'any text file on my system here,  using the filesystemobject
>    x = x + 1
>     document.all.MyData.innerText = x & " -- " & time
> yID = setTimeout ("Gpwsm", 1000)
> End Sub

> </SCRIPT>

> <body onLoad="Gpwsm()" background = "white">

> <P ID="MyData"></P>

> </body>

> John



Sun, 22 Jun 2003 11:26:26 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. ** ? concerning CreateObject("Scripting.FileSystemObject")

2. CreateObject("Scripting.FileSystemObject") doesnt work

3. CreateObject("Scripting.FileSystemObject")

4. Set filesys = CreateObject("Scripting.FileSystemObject")

5. CreateObject("Scripting.FileSystemObject") Error

6. Set fs = CreateObject("Scripting.FileSystemObject")-error

7. CreateObject("Scripting.FileSystemObject") Error

8. Set fso = Server.CreateObject("Scripting.FileSystemObject")

9. Trouble with CreateObject("Scripting.FileSystemObject")

10. Server.CreateObject("Scripting.FileSystemObject")

11. Set filesys = CreateObject("Scripting.FileSystemObject")

12. CreateObject("Scripting.FileSystemObject") not working

 

 
Powered by phpBB® Forum Software