Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   File System Object (http://www.velocityreviews.com/forums/t59628-file-system-object.html)

Vicky S 07-14-2003 04:10 PM

File System Object
 

Hello,
I'm new to dot net and I can't seem to find the object name that is
equivalent to Scripting.FileSystemObject. Can anyone help?

Thanks,
V



Vicky S 07-14-2003 04:59 PM

Re: File System Object
 

and also.. for the functions right(string, len_returned) and left(string,
len_returned)

"Vicky S" <rainstorms@comcast.net> wrote in message
news:%233MWUKiSDHA.1556@TK2MSFTNGP10.phx.gbl...
>
> Hello,
> I'm new to dot net and I can't seem to find the object name that is
> equivalent to Scripting.FileSystemObject. Can anyone help?
>
> Thanks,
> V
>
>




Juliano Bortolozzi 07-14-2003 05:33 PM

Re: File System Object
 
Take a look at System.IO

"Vicky S" <rainstorms@comcast.net> wrote in message
news:#3MWUKiSDHA.1556@TK2MSFTNGP10.phx.gbl...
>
> Hello,
> I'm new to dot net and I can't seem to find the object name that is
> equivalent to Scripting.FileSystemObject. Can anyone help?
>
> Thanks,
> V
>
>




Vicky S 07-14-2003 06:26 PM

Re: File System Object
 

Thanks,
I can now generate a file.. but for some reason, it's not writing to it..
what am I doing wrong?

Dim oFile As System.IO.File, oStream As System.IO.StreamWriter

Dim filename As String

filename = Application.ExecutablePath & "\..\importlog.txt"

oStream = oFile.CreateText(filename)

oStream.WriteLine(Now() & " " & strMessage)



"Juliano Bortolozzi" <julianobortolozzi@hotmail.com> wrote in message
news:uxOsQ4iSDHA.2276@TK2MSFTNGP10.phx.gbl...
> Take a look at System.IO
>
> "Vicky S" <rainstorms@comcast.net> wrote in message
> news:#3MWUKiSDHA.1556@TK2MSFTNGP10.phx.gbl...
> >
> > Hello,
> > I'm new to dot net and I can't seem to find the object name that is
> > equivalent to Scripting.FileSystemObject. Can anyone help?
> >
> > Thanks,
> > V
> >
> >

>
>




Juliano Bortolozzi 07-14-2003 06:49 PM

Re: File System Object
 
In your example you just have to call the Close method of the stream object.

But, to do what you want, I'd consider a different approach:

Dim stream As System.IO.StreamWriter

Try

stream = New System.IO.StreamWriter("c:\temp\test.txt", True)

stream.Write("test")

Finally

If Not stream Is Nothing Then

stream.Close()

End If

End Try


Note that you can't forget to close the stream, even if an exception has
occured.

"Vicky S" <rainstorms@comcast.net> wrote in message
news:#TCbPWjSDHA.1572@TK2MSFTNGP12.phx.gbl...
>
> Thanks,
> I can now generate a file.. but for some reason, it's not writing to it..
> what am I doing wrong?
>
> Dim oFile As System.IO.File, oStream As System.IO.StreamWriter
>
> Dim filename As String
>
> filename = Application.ExecutablePath & "\..\importlog.txt"
>
> oStream = oFile.CreateText(filename)
>
> oStream.WriteLine(Now() & " " & strMessage)
>
>
>
> "Juliano Bortolozzi" <julianobortolozzi@hotmail.com> wrote in message
> news:uxOsQ4iSDHA.2276@TK2MSFTNGP10.phx.gbl...
> > Take a look at System.IO
> >
> > "Vicky S" <rainstorms@comcast.net> wrote in message
> > news:#3MWUKiSDHA.1556@TK2MSFTNGP10.phx.gbl...
> > >
> > > Hello,
> > > I'm new to dot net and I can't seem to find the object name that is
> > > equivalent to Scripting.FileSystemObject. Can anyone help?
> > >
> > > Thanks,
> > > V
> > >
> > >

> >
> >

>
>





All times are GMT. The time now is 03:13 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.