| | |
c# to VB.Net
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
Hi Guys,
Im more familiar with coding in C# ... can someone please help me to convert the line highlighted below into VB.NET
Much appreciated
Im more familiar with coding in C# ... can someone please help me to convert the line highlighted below into VB.NET
Much appreciated
private int file_count = 0;
///
/// Get the file count of a given directory recursively.
///
public void GetDirectoryFileCount(string dir)
{
dir = dir + @”\”;
//get all the directories and files inside a directory
String[] all_files=Directory.GetFileSystemEntries(dir);
//loop through all items
foreach(string file in all_files)
{
//check to see if the file is a directory if not increment the count
if(Directory.Exists(file))
{
//recursive call
GetDirectoryFileCount(file);
}
else
{
//increment file count
file_count++;
}
}
} Michelle (Junior Developer)
That's your codes or get from internet?
vbnet Syntax (Toggle Plain Text)
Private file_count As Integer = 0 Public Sub GetDirectoryFileCount(ByVal dir As String) dir = dir & ”\” Dim all_files() As String=Directory.GetFileSystemEntries(dir) For Each file As String In all_files If Directory.Exists(file) Then GetDirectoryFileCount(file) Else file_count += 1 End If Next file End Sub
Last edited by Jx_Man; Sep 22nd, 2008 at 12:43 pm.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
Similar Threads
- Freelance .NET / MS SQL developer (Web Development Job Offers)
- .Net Application Developer (Software Development Job Offers)
- .net Software Engineer (Software Development Job Offers)
- .NET Consultant (Software Development Job Offers)
- Software Engineer (.NET , SQL) (Software Development Job Offers)
- ASP.Net / C# Web Developer (Web Development Job Offers)
- ProgrammersTalk.net Recruiting Forum Posters (Internet Marketing Job Offers)
- .NET developers team searches projects (Post your Resume)
Other Threads in the VB.NET Forum
- Previous Thread: counting how many text boxes have been modified
- Next Thread: Can it be done?
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account array basic beginner bing browser button buttons center check code crystalreport cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist eclipse excel fade file-dialog filter forms ftp generatetags gridview html images input insert intel internet listview mobile monitor net objects open output panel passingparameters pdf picturebox port position print printing problem read remove save searchbox searchvb.net select serial settings shutdown soap sqlserver survey table tcp temperature text textbox timer timespan toolbox transparency trim update user vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode year






