Hi,
Here is the code I used to list the directory using java.io.File. Is this
what you were trying to do? Can we see a code snippet?
[quoted text, click to view] >>
public class dirlist {
public static void main(String [] args) {
java.io.File file = new java.io.File("C:\\temp");
String [] list = file.list();
if (list != null) {
for (int i = 0; i< list.length; i++) {
System.out.println(list[i]);
}
}
}
}
[quoted text, click to view] >>
BTW, I have missed out error checking in this snippet.
Thanks
Sadagopan Rajaram
Microsoft Visual J# .NET Product Team.
This posting is provided "AS IS" with no warranties, and confers no
rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm --------------------
[quoted text, click to view] >Thread-Topic: how do i list directory files with j++?
>thread-index: AcReMEz2Q1enonXrRuGbHSiWONMUzw==
>X-WBNR-Posting-Host: 12.215.167.138
>From: "=?Utf-8?B?Y2hyaXM=?=" <chris@discussions.microsoft.com>
>Subject: how do i list directory files with j++?
>Date: Tue, 29 Jun 2004 16:25:01 -0700
>Lines: 2
>Message-ID: <826E7C52-A7EB-4EF1-9A71-16685263D097@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.dotnet.vjsharp
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 127.0.0.1
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.vjsharp:6152
>X-Tomcat-NG: microsoft.public.dotnet.vjsharp
>
>I've tried using list(), but i get told that it is not part of the File
class. am i using the wrong library? or something else stupid. i would
appreciate some help, thanks
[quoted text, click to view] >chris
>