Darren66 Posted June 30, 2003 Posted June 30, 2003 I want to find the size of a directory which I know will have no subdirectories. On my local machine the following works fine: Imports System.IO Public Function DirSize() As Integer Dim d As New DirectoryInfo("c:\Darren") Dim Size As Long = 0 Dim fis As FileInfo() = d.GetFiles() Dim fi As FileInfo For Each fi In fis Size += fi.Length Next fi Return Size End Function However what I really need is to find the size of a directory that resides on the internet and I can't seem to get it to work.... Any suggestions? Quote
Administrators PlausiblyDamp Posted June 30, 2003 Administrators Posted June 30, 2003 How are you trying to access the remote directory? Any code written so far? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Darren66 Posted June 30, 2003 Author Posted June 30, 2003 I've been using the WinInet API's to access the Internet and put files in the directory specifically: InternetConnect, InternetOpen, FtpPutFile. This all works fine. But I couldn't find anything for determining the directory size. It seemed like it should be fairly simple, but it's got me! Quote
Administrators PlausiblyDamp Posted June 30, 2003 Administrators Posted June 30, 2003 If you're using .Net then System.Net will give you a lot of features without having to delve into APIs. The following article on codeproject may help (In C# though) http://www.codeproject.com/csharp/FTP.asp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.