vb代码翻译成vb.net代码打开VS2005及以上版本,新建一个VB.NET语言的项目,然后点工具-升级VB6代码,把代码粘贴进去即可
请教这段VB6.0代码翻译为vb.net代码,谢谢'---------------------以下放在模块中-----------------------
Private Const NO_ERROR = 0
Private Const INTERNET_OPTION_END_BROWSER_SESSION = 42
Private Const CSIDL_COOKIES = H21
Private Structure SHITEMID
Dim cb As Long
Dim abID As Byte
End Structure
Private Structure ITEMIDLIST
Dim mkid As SHITEMID
End Structure
Private Declare Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA" (ByVal hWnd As Long, ByVal szApp As String, ByVal szOtherStuff As String, ByVal hIcon As Long) As Long
Private Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" (ByVal hwndOwner As Long, ByVal nFolder As Long, ByVal pidl As ITEMIDLIST) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Declare Function InternetSetOption Lib "wininet.dll" Alias "InternetSetOptionA" (ByVal hInternet As Long, ByVal dwOption As Long, ByRef lpBuffer As Long, ByVal dwBufferLength As Long) As Long
Private Function GetSpecialfolder(ByVal CSIDL As Long) As String
【vb翻译成vb.net vb做中文翻译英文】Dim r As Long
Dim IDL As ITEMIDLIST
'Getthespecialfolder
Dim path As String
r = SHGetSpecialFolderLocation(100, CSIDL, IDL)
If r = NO_ERROR Then
'Createabuffer
path = Space$(512)
'GetthepathfromtheIDList
r = SHGetPathFromIDList(IDL.mkid.cb, path$)
'Removetheunnecessarychr$(0)'s
GetSpecialfolder = Left$(path, InStr(path, Chr(0)) - 1)
Exit Function
End If
GetSpecialfolder = ""
End Function
Public Sub ISetOption()
Dim CookiesPath As String
CookiesPath = GetSpecialfolder(CSIDL_COOKIES)
InternetSetOption(0, INTERNET_OPTION_END_BROWSER_SESSION, 0, 0)
End Sub
'--------------------------模块结束---------------------
'这样调用
ISetOption()
请教!VB6.0代码翻译为vb.net代码,谢谢引用 Microsoft DAO 3.6 Object Library
Public Function DaoOpenDB(ByVal pDbType As String, ByVal pDbName As String, ByVal pMdbCnct As String) As Integer
On Error GoTo Err_Handler
Dim m_DbDataBase As DAO.Database
Dim gwsMainworkSpace As DAO.Workspace
Dim DAODBEngine As New DAO.DBEngine()
Dim m_DbWkSpace = DAODBEngine.CreateWorkspace("", " Admin ", "")
If pDbType = "c_ACCESS" Then
'Access
m_DbDataBase = m_DbWkSpace.OpenDatabase(pDbName)
Else
'Oracle
m_DbDataBase = m_DbWkSpace.OpenDatabase(pDbName, True, False, pMdbCnct)
End If
DaoOpenDB = c_OK 'vb翻译成vb.net你在全局中已定义
Exit Function
Err_Handler:
DaoOpenDB = c_NG 'vb翻译成vb.net你在全局中已定义
MsgBox(Err.Description, MsgBoxStyle.OkOnlyMsgBoxStyle.Critical, "Err")
End Function
vb翻译成vb.net的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vb做中文翻译英文、vb翻译成vb.net的信息别忘了在本站进行查找喔 。
推荐阅读
- 杯子蛋糕教程直播,杯子蛋糕步骤
- js自定义排序函数,js 自定义排序
- python填充单元格颜色代码,python中填充颜色的函数
- 关于美国服务器就要用科捷16的信息
- vb.net用什么书 vbnet语言
- redis重启客户端命令,redis重启命令行
- u盘恢复覆盖的文件怎么恢复,u盘资料被覆盖一次还可以恢复
- 娇兰金钻粉底直播卖货,娇兰金钻粉底代购价格
- c语言判定偶数的函数 c++偶数判断