Dim extsubkey = Registry.ClassesRoot.OpenSubKey(".xls")
'从注册表中读取扩展名相应的子键
If extsubkey IsNot Nothing Then
Dim extdefaultvalue = DirectCast(extsubkey.GetValue(Nothing), String)
'取出扩展名对应的文件类型名称
Dim typesubkey = Registry.ClassesRoot.OpenSubKey(extdefaultvalue)
'从注册表中读取文件类型名称的相应子键
If typesubkey IsNot Nothing Then
Dim description = DirectCast(typesubkey.GetValue(Nothing), String)
'得到类型描述字符串
Dim defaulticonsubkey = typesubkey.OpenSubKey("DefaultIcon")
'取默认图标子键
If defaulticonsubkey IsNot Nothing Then
'得到图标来源字符串
Dim defaulticon = DirectCast(defaulticonsubkey.GetValue(Nothing), String)
'取出默认图标来源字符串
Dim iconstringArray = defaulticon.Split(","C)
Dim nIconIndex As Integer = 0
If iconstringArray.Length > 1 Then
Integer.TryParse(iconstringArray(1), nIconIndex)
End If
'得到图标
Dim phiconLarge As new System.IntPtr
Dim phiconSmall As new System.IntPtr
ExtractIconExW(iconstringArray(0).Trim(""""C), nIconIndex, phiconLarge, phiconSmall, 1)
Dim icon As icon = Icon.FromHandle(phiconLarge)
Dim fileStream As new System.IO.FileStream("c:\test.ico", System.IO.FileMode.Create)
icon.Save(fileStream)
fileStream.Close()
End If
End If
End If
请问这段内容如何才能在FT里运行