Click here to Skip to main content
15,898,222 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Microsoft Office Document Image Writer Pin
Dave Kreskowiak22-Jun-07 5:00
mveDave Kreskowiak22-Jun-07 5:00 
GeneralRe: Microsoft Office Document Image Writer Pin
dBrong22-Jun-07 5:09
dBrong22-Jun-07 5:09 
GeneralRe: Microsoft Office Document Image Writer Pin
Dave Kreskowiak22-Jun-07 8:54
mveDave Kreskowiak22-Jun-07 8:54 
GeneralRe: Microsoft Office Document Image Writer Pin
dBrong22-Jun-07 13:33
dBrong22-Jun-07 13:33 
QuestionImports - Count files in a folder Pin
Central_IT22-Jun-07 4:28
Central_IT22-Jun-07 4:28 
AnswerRe: Imports - Count files in a folder Pin
Kerry Drake22-Jun-07 4:54
Kerry Drake22-Jun-07 4:54 
AnswerRe: Imports - Count files in a folder Pin
originSH22-Jun-07 4:54
originSH22-Jun-07 4:54 
AnswerRe: Imports - Count files in a folder Pin
Dave Kreskowiak22-Jun-07 4:58
mveDave Kreskowiak22-Jun-07 4:58 
There is no import for the FileSystemObject. You would normally have to set a reference to the Windows Scripting Host. But, it's pointless to do this under the .NET Framework.

Scrap this code and rewrite it using the classes in the System.Io namespace. The FileSystemObject is not needed in VB.NET. Also, the return type, Long in VB6, is a 32-bit signed interger. In VB.NET, this same Long datatype name is a 64-bit signed integer. Be careful when translating VB6 code to VB.NET.
Imports System.Io
.
.
.
Public Shared Function GetFileCount(ByVal folderPath As String) As Integer
    If Not Directory.Exists(folderPath) Then
        Throw New DirectoryNotFoundException("The specified path was not found.")
    End If

    Dim filenames As String()
    filenames = Directory.GetFiles(folderPath)
    Return filenames.Length
End Function



A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


AnswerRe: Imports - Count files in a folder Pin
mr_lasseter22-Jun-07 5:02
mr_lasseter22-Jun-07 5:02 
QuestionInsert statement using vb.net Pin
jds120722-Jun-07 4:18
jds120722-Jun-07 4:18 
AnswerRe: Insert statement using vb.net Pin
Vasudevan Deepak Kumar22-Jun-07 4:20
Vasudevan Deepak Kumar22-Jun-07 4:20 
AnswerRe: Insert statement using vb.net Pin
Dave Kreskowiak22-Jun-07 4:26
mveDave Kreskowiak22-Jun-07 4:26 
Questionhow do solve this error for sending mail in vb.net? Pin
sathyan_829422-Jun-07 2:56
sathyan_829422-Jun-07 2:56 
AnswerRe: how do solve this error for sending mail in vb.net? Pin
Vasudevan Deepak Kumar22-Jun-07 4:15
Vasudevan Deepak Kumar22-Jun-07 4:15 
QuestionReporting Services, getting parameter values Pin
Rene14722-Jun-07 2:35
Rene14722-Jun-07 2:35 
Questiondeployment in window applications. Pin
Sonia Gupta22-Jun-07 1:37
Sonia Gupta22-Jun-07 1:37 
AnswerRe: deployment in window applications. Pin
Sathesh Sakthivel22-Jun-07 1:38
Sathesh Sakthivel22-Jun-07 1:38 
GeneralRe: deployment in window applications. Pin
Sonia Gupta22-Jun-07 1:51
Sonia Gupta22-Jun-07 1:51 
AnswerRe: deployment in window applications. Pin
kubben22-Jun-07 1:59
kubben22-Jun-07 1:59 
QuestionRe: deployment in window applications. Pin
Sonia Gupta22-Jun-07 2:07
Sonia Gupta22-Jun-07 2:07 
AnswerRe: deployment in window applications. Pin
kubben22-Jun-07 2:10
kubben22-Jun-07 2:10 
Questionemail validation in windows application [modified] Pin
praveenkumar palla22-Jun-07 1:25
praveenkumar palla22-Jun-07 1:25 
AnswerRe: email validation in web application Pin
Sathesh Sakthivel22-Jun-07 1:39
Sathesh Sakthivel22-Jun-07 1:39 
GeneralRe: email validation in web application Pin
praveenkumar palla22-Jun-07 3:39
praveenkumar palla22-Jun-07 3:39 
GeneralRe: email validation in web application Pin
Dave Kreskowiak22-Jun-07 4:22
mveDave Kreskowiak22-Jun-07 4:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.