Tutorials Forums
     Tutorials Videos
        Sign Up Now For FREE
Welcome, Guest
Username Password: Remember me

Get information on a file extention
(1 viewing) (1) Guest
VB.NET HELP, VB.NET TUTORIALS, VB.NET CODE, VB.NET PROGRAMMING, VB.NET

Visual Basic.NET is the most recent generation of Visual Basic. Developers will be pleased to note that its new features include inheritance, method overloading, structured exception handling, and more. These capabilities make it easier than ever to create .NET applications, including Windows applications, web services, and web applications. The articles in this section give you all the tips you need to work wit this useful language.
  • Page:
  • 1

TOPIC: Get information on a file extention

Get information on a file extention 09 Dec 2009 15:43 #76

Instructions: Use the Sub New inside the structure to create a new instance of the structure. Example, to get information on the .jpg file extention, do

Dim jpgInfo As New ExtentionInfo(".jpg")

 
Public Structure ExtentionInfo
Sub New(ByVal FileExtention As String)
Extention = FileExtention
Try
Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(FileExtention)
ExistsinRegistry = True
Dim base As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(key.GetValue(""))
IconPath = base.OpenSubKey("DefaultIcon").GetValue("")
OpenWith = base.OpenSubKey("Shell").OpenSubKey("Open").OpenSubKey("command").GetValue("")
Description = base.GetValue("")
Catch ex As Exception
ExistsinRegistry = False
End Try
End Sub
Dim Description As String
Dim Extention As String
Dim IconPath As String
Dim OpenWith As String
Dim ExistsinRegistry As Boolean
End Structure
 
  • CE
  • OFFLINE
  • Administrator
  • Posts: 197
  • Karma: 78
CodersEngine
  • Page:
  • 1
Time to create page: 0.26 seconds