Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Limitation in the System.IO.FileInfo.get_Length()
Message
From
05/03/2010 03:41:40
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01452685
Message ID:
01452696
Views:
40
>I don't understand. I think you need to post some code

The correct location is when the loFile.Length is used, which is an object from FileInfo.

Here is a portion of the code:
            loDirectoryInfo = New DirectoryInfo(cDirectory)

            Try
                loFiles = loDirectoryInfo.GetFiles(cFilter)

                ' Get all the files in the directory
                For Each loFile In loFiles
                    loRow = oDataSet.Tables(0).NewRow

                    loRow("Extension") = loFile.Extension
                    loRow("LastUpdate") = loFile.LastWriteTime
                    loRow("Name") = Trim(loFile.Name)
                    loRow("Size") = loFile.Length
So, the last line is where the problem is. As soon as I have a file name having more than 160 characters, loFile.Length will generate an error.

And, it is not about the loRow("Size") field. I tried to dump loFile.Length into a double variable and it was the same.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform