Jump to content

Recommended Posts

Posted

Boas, tenho um pequeno problema, precissava de trespassar um codigo que esta em C# para VB, para poder funciar com ele em .aspx

<% 

strPath = server.mappath("images/")

Set DataList = CreateObject("ADODB.Recordset")
DataList.Fields.Append "strFileName", 200, 255 ' adVarChar
DataList.Fields.Append "strFileSize", 3, 4 ' adInteger
DataList.Fields.Append "strFileDate", 7 ' adDate
DataList.Open
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strPath)
For Each objFile In objFolder.Files
DataList.AddNew
DataList("strFileName") = objFile.Name
DataList("strFileSize") = Int(objFile.Size/1000)
If DataList("strFileSize") = 0 Then DataList("strFileSize") = 1
DataList("strFileDate") = objFile.DateLastModified
DataList.Update
Next
DataList.Sort = "strFile" & "Date"
DataList.MoveFirst
Do Until DataList.EOF
strFile = DataList.Fields.Item("strFileName")
strFileLG = Len(strFile)
intPadding = 15 - strFileLG
strDisplayName = strFile
If NOT (strDisplayName = "inicio.jpg") Then
response.write "<a class='highslide' href='images/" + strDisplayName + "' onclick='return hs.expand(this, inPageOptions)'><img src='images/" + strDisplayName + "'/></a>"
End If
DataList.MoveNext
Loop

%>

se alguem conseguisse *.*

Posted

Olá,

Isto não é C# é VB para ASP (designado agora como classic ASP). Tu queres é converter esse código para VB.NET para usares em ASP.NET.

No entanto, e como as tecnologias já alteraram bastante, não podes simplesmente converter isso para VB.NET e ficar a funcionar. Vê o que precisas e é melhor re-fazer do que converter.

Posted

pois, precisso de refazer isso para poder funcionar com ele em VB.net ... o problema é que não percebo la muito disto ... se alguem me conseguisse ajudar a refazer o codigo

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.