In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to group according to the VB.NET extension. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
VB.NET extension grouping case:
Public Class Form1 'groups files Private Sub button1_Click (ByVal sender As System.Object) by extension ByVal e As System.EventArgs) Handles button1.Click Dim MyDir As String = Me.textBox1.Text Dim MyFiles As IEnumerable (Of System.IO.FileInfo) = GetFiles (MyDir) Dim MyQueryGroup = From MyFileIn MyFiles _ Group MyFile By MyExt = MyFile.Extension.ToLower () _ Into MyFileGroup = Group _ Order By MyExt Me.listBox1.Items.Clear () For Each MyFileGroup In MyQueryGroup Me.listBox1.Items.Add ("files containing the" + MyFileGroup.MyExt + "extension are as follows:") For Each MyFileInfo In MyFileGroup.MyFileGroup Me.listBox1.Items.Add (MyFileInfo.Name) Next Me.listBox1.Items.Add ("") Next End Sub 'more .net source code and examples From Lebo www.lob.cn Function GetFiles (ByVal MyDir As String) As IEnumerable (Of System.IO.FileInfo) If (Not System.IO.Directory.Exists (MyDir)) Then Throw New System.IO.DirectoryNotFoundException () End If Dim MyFileNames As String () Dim MyFiles As List (Of System.IO.FileInfo) = New List (Of System.IO.FileInfo) () 'find all files in all subdirectories under the specified directory' MyFileNames = System.IO.Directory.GetFiles (MyDir, "*. *" _ 'System.IO.SearchOption.AllDirectories) MyFileNames = System.IO.Directory.GetFiles (MyDir) For Each MyName As String In MyFileNames MyFiles.Add (New System.IO.FileInfo (MyName)) Next Return MyFiles End Function End Class on "how to group by VB.NET extension" ends here Hope that the above content can be helpful to you, so that you can learn more knowledge, if you think the article is good, please 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.