File IO and Systems Object
File IO and Systems Object
File IO and Systems Object
File IO and Systems Object
File IO and Systems Object
File IO and Systems Object File IO and Systems Object File IO and Systems Object File IO and Systems Object File IO and Systems Object File IO and Systems Object File IO and Systems Object File IO and Systems Object
File IO and Systems Object File IO and Systems Object
File IO and Systems Object
Go Back  Xtreme Visual Basic Talk > > > File IO and Systems Object


Reply
 
Thread Tools Display Modes
  #1  
Old 01-19-2004, 08:50 PM
byon byon is offline
Newcomer
 
Join Date: Aug 2003
Location: Singapore
Posts: 21
Default File IO and Systems Object


I got a problem here while writing these codes in the Console Application

Quote:
Dim str() as string, intX as integer
Str() = Directory .GetLogicalDrives
For intX = 0 to str.Length - 1
Console.Writeline(Str(intx))
Next
it seems that my directory becomes invalid.

how do i solve it?
Reply With Quote
  #2  
Old 01-19-2004, 09:39 PM
VBJoe's Avatar
VBJoeFile IO and Systems Object VBJoe is offline
Village VB Idiot

* Expert *
 
Join Date: Jan 2003
Location: Idaho
Posts: 1,850
Default

I assume that you're using VB.NET. (your question should actually be posted in one of the .NET Forums)

As to your question: I'm not sure if it matters, but Str is a function, so it might not be a good idea to name a variable Str. When I test your code in Visual Studio, it has all kinds of problems. If a change just a few things, it works. (I'm using a Text Box rather than Console.WriteLine, but I don't think it will make a difference):
Code:
Dim abc() As String, intX As Integer abc = System.IO.Directory.GetLogicalDrives For intX = 0 To abc.Length - 1 txtOutput.Text = txtOutput.Text & abc(intX) & vbCrLf Next
Reply With Quote
  #3  
Old 01-19-2004, 10:32 PM
byon byon is offline
Newcomer
 
Join Date: Aug 2003
Location: Singapore
Posts: 21
Default

oh
i think i placed a Imports System.IO
and it solved that directory.

thanks! your solution helps also.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Class not registered file... XXXX.DLL FILE NEEDED Pogo_2111 Database and Reporting 2 08-11-2003 03:47 AM
Validating XML file Mowzee General 0 07-08-2003 03:33 AM
decompress UNIX gzip files with zlib.dll? wendy General 15 03-31-2003 10:24 AM
Object variable or With block variable not set minbar Database and Reporting 5 11-19-2002 03:36 AM
Saving bitmaps to a binary file poorboy General 18 05-16-2001 03:39 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
File IO and Systems Object
File IO and Systems Object
File IO and Systems Object File IO and Systems Object
File IO and Systems Object
File IO and Systems Object
File IO and Systems Object File IO and Systems Object File IO and Systems Object File IO and Systems Object File IO and Systems Object File IO and Systems Object File IO and Systems Object
File IO and Systems Object
File IO and Systems Object
 
File IO and Systems Object
File IO and Systems Object
 
-->