|
-
Apr 23rd, 2013, 04:44 PM
#1
Thread Starter
New Member
MSDN Directory.GetFiles Method
Trying to use the sample code from MSDN Directory.GetFiles Method http://msdn.microsoft.com/en-us/library/07wt70x2.aspx
When you start the program I call Main() but what is the args() that needs to get passed. I thought it was the path to where the files are located but when I use the path "C:\" I get the error Value of type "String' cannot be convered to a '1-dimensional array of string' Can someone let me know what the args is in this code and if it is not the path then where does the path get set?
' For Directory.GetFiles and Directory.GetDirectories
' For File.Exists, Directory.Exists
Public Overloads Shared Sub Main(ByVal args() As String)
Dim path As String
MessageBox.Show(path)
For Each path In args
If File.Exists(path) Then
' This path is a file.
ProcessFile(path)
Else
If Directory.Exists(path) Then
' This path is a directory.
ProcessDirectory(path)
Else
MessageBox.Show("{0} is not a valid file or directory.", path)
End If
End If
Next path
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|