Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function GetMimeType(ByVal filePathArg As String) As String
Dim registryPermission As RegistryPermission = New RegistryPermission(RegistryPermissionAccess.Read, "\\HKEY_CLASSES_ROOT")
Dim hiveClassesRoot As RegistryKey = Registry.ClassesRoot
Dim myFileInfo = New FileInfo(filePathArg)
Dim fileExtension As String = LCase(myFileInfo.Extension)
Dim keyContentType As RegistryKey = hiveClassesRoot.OpenSubKey("MIME\Database\Content Type")
Dim keyName As String
For Each keyName In keyContentType.GetSubKeyNames()
Dim currentKey As RegistryKey = hiveClassesRoot.OpenSubKey("MIME\Database\Content Type\" & keyName)
If LCase(currentKey.GetValue("Extension")) = fileExtension Then
Return keyName
End If
Next
End Function