Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

An example Analysis of API realized by VB.NET path selection Dialog

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the VB.NET path selection dialog box to achieve API example analysis, the content is very detailed, interested friends can refer to, hope to be helpful to you.

The language VB.NET is familiar to most of us. But today or here to introduce the first to accept VB.NET, more important is to let you have an in-depth understanding of the VB.NET path selection directory dialog example.

VB.NET is the abbreviation of Visual Basic.net. When it comes to VB.NET, you have to mention vb (Visual Basic) first. Visual Basic is a simple and easy-to-learn programming language under the Windows environment. Because of its speed and efficiency in developing programs, it is loved by programmers. Strictly speaking, Visual Basic is only a semi-object-oriented language, and its object-oriented ability and program execution efficiency often can not meet the needs of some programmers. Therefore, large projects rarely use Visual Basic to develop. One version of Visual Basic is Visual Basic 6. 0. After Visual Basic 6.0, Microsoft launched a brand-new ".net architecture". In its * versions-Visual Studio.NET 7.0, it integrates Visual Basic 7.0,Visual C++ 7.0and Clippers, of which Visual Basic 7.0is the * version of vb.net. Now the .NET version is Visual Studio 2005, and the corresponding vb.net version is Visual Basic 2005 (vb 9.0), also known as vb.net 2005. The following describes the implementation of the VB.NET path selection directory dialog box (API):

Private Type BrowseInfo hWndOwner As Long pIDLRoot As Long pszDisplayName As Long lpszTitle As Long ulFlags As Long lpfnCallback As Long lParam As Long iImage As Long End Type Const BIF_RETURNONLYFSDIRS = 1 Const MAX_PATH = 260 Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal hMem As Long) Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long ByVal lpBuffer As String) As Long Private Function getFolder (ByVal title As String) As String Dim iNull As Integer, lpIDList As Long, lResult As Long Dim sPath As String, udtBI As BrowseInfo With udtBI 'sets the parent window handle of the pop-up dialog .hWndOwner = Me.hWnd .lpszTitle = lstrcat (title, ")' title .ulFlags = BIF_RETURNONLYFSDIRS End With lpIDList = SHBrowseForFolder (udtBI) If lpIDList Then sPath = String$ (MAX_PATH, 0) SHGetPathFromIDList lpIDList, sPath CoTaskMemFree lpIDList iNull = InStr (sPath) VbNullChar) If iNull Then sPath = Left$ (sPath, iNull-1) End If End If getFolder = sPath End Function Private Sub Command1_Click () Text1.Text = getFolder ("Please choose a folder") End Sub about the VB.NET path selection dialog box to implement API case analysis is here. I hope the above content can be of some help to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report