Foxtable(狐表)用户栏目专家坐堂 → [求助]帮忙改改这段内容 谢谢


  共有1649人关注过本帖平板打印复制链接

主题:[求助]帮忙改改这段内容 谢谢

帅哥哟,离线,有人找我吗?
jiskin
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:713 积分:5196 威望:0 精华:0 注册:2012/4/13 13:10:00
[求助]帮忙改改这段内容 谢谢  发帖心情 Post By:2016/6/15 15:28:00 [只看该作者]

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里运行

 回到顶部