Hi
Please transilate the following code for me to C#:This function collects and displays the files in a specified folder as hypelinks on a webpage. I would like to attach this to a TreeView control on an aspx webpage.Thanks in advance.I would also like to have the file list as hyperlinks ,so that the files opens when clicked on.
Function ShowOfferFileList(folderspec)
dim FileExtension
dim FilePath
Dim fso, f, f1, fc, strList
dim i
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set fc = f.Files
For Each f1 in fc
FilePath = cstr(f1.name)
FileExtension = GetExtension(FilePath)
'FileExtension = mid(FilePath, len(FilePath) - 3, 3)
'FileExtension = mid(FilePath, 1, 3)
if UCase(FileExtension) = "HTML" or UCase(FileExtension) = "MPP" or UCase(FileExtension) = "PDF" or UCase(FileExtension) = "MHT" or UCase(FileExtension) = "MHTML" then
i = i + 1
FilePath = TheOfferDataPath & "\" & FilePath
strList = strList & "<A href=" & FilePath & ">"
strList = strList & "<" & i & "> " & f1.name & "</A>" ' is a " & UCase(FileExtension)
strList = strList & "<BR>"
end if
Next
'ShowFileList = strList
TheOffer = strList
End Function

Bind folder structure to a Treeview
DoonNicolas&#33;
Hi Wendy, these forums are not meant to only post code that needs to be translated. It is about people who encouter a problem when trying to write an application. Just translation from one language to another is not a real problem. Dive into it and do it yourself.
Frances83
Editting doesn't seem to work
Hint: take a look at the System.IO namespace, and especially the DirectoryInfo and FileInfo classes. DirectoryInfo contains methods like GetFiles()...
Mirricle
Here is a thread with the same question: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=565485&SiteID=1&mode=1
lord_8
True, it is old school so there is no way to convert it to C# unless translated.
Shadowsoul
Hi
Convert your code in this link http://www.developerfusion.co.uk/utilities/convertvbtocsharp.aspx
Hope this helps
kuvve
maybe I interpreted the code wrong, but this seems to be oldscool VB and not VB.Net. The link you provided is for converting VB.Net code to C#.
Wendy, did you get any further