Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > File System Object

Reply
Thread Tools

File System Object

 
 
Vicky S
Guest
Posts: n/a
 
      07-14-2003

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


 
Reply With Quote
 
 
 
 
Vicky S
Guest
Posts: n/a
 
      07-14-2003

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

"Vicky S" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> 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
>
>



 
Reply With Quote
 
 
 
 
Juliano Bortolozzi
Guest
Posts: n/a
 
      07-14-2003
Take a look at System.IO

"Vicky S" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
>
> 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
>
>



 
Reply With Quote
 
Vicky S
Guest
Posts: n/a
 
      07-14-2003

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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Take a look at System.IO
>
> "Vicky S" <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
> >
> > 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
> >
> >

>
>



 
Reply With Quote
 
Juliano Bortolozzi
Guest
Posts: n/a
 
      07-14-2003
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" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
>
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Take a look at System.IO
> >
> > "Vicky S" <(E-Mail Removed)> wrote in message
> > news:#(E-Mail Removed)...
> > >
> > > 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
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File System Object - not deleting file Lise ASP General 3 06-08-2006 03:14 PM
Object reference not set to an instance of an object. System.Web.UI.WebControls.ListItemCollection.SaveViewState() System.Web.UI.WebControls.ListControl.SaveViewState() Brano ASP .Net 3 11-08-2005 12:29 PM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
System.Security.SecurityException: Error de solicitud de permiso de tipo System.Net.WebPermission, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. Luis Esteban Valencia ASP .Net 0 07-14-2005 01:43 PM
Why are sender and object used as in sender As System.Object, ByVal e As System.EventArgs? Showjumper ASP .Net 2 08-02-2003 10:53 PM



Advertisments