资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

vb翻译成vb.net vba编程翻译器

如何vb转换到vb.net

你可以直接打开 VB6 的程序,VB.net 会自动启动升级向导将你的 VB6 代码升级为 VB.net。

公司主营业务:成都做网站、网站设计、外贸营销网站建设、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联公司是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联公司推出龙湖免费做网站回馈大家。

请教!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 '你在全局中已定义

Exit Function

Err_Handler:

DaoOpenDB = c_NG '你在全局中已定义

MsgBox(Err.Description, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, "Err")

End Function

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

Dim r As Long

Dim IDL As ITEMIDLIST

'Get the special folder

Dim path As String

r = SHGetSpecialFolderLocation(100, CSIDL, IDL)

If r = NO_ERROR Then

'Create a buffer

path = Space$(512)

'Get the path from the IDList

r = SHGetPathFromIDList(IDL.mkid.cb, path$)

'Remove the unnecessary chr$(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()


网站栏目:vb翻译成vb.net vba编程翻译器
网站地址:http://cdkjz.cn/article/dosihsd.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220