首页 > 开发 > .Net > 正文

VB.NET里最方面的XP风格解决方案

2020-02-03 15:26:31
字体:
来源:转载
供稿:网友
 

将以下代码添加到initializecomponent()之后

on error resume next
        dim y as integer
        dim appname as string
        dim manfilename as string
        dim fullappexenameandpath as string
        fullappexenameandpath = application.executablepath
        y = application.startuppath.length
        ' y = fullappexenameandpath.lastindexof("")
        y = y + 1
        appname = fullappexenameandpath.substring(y, fullappexenameandpath.length - y)
        manfilename = appname & ".manifest"

        if system.io.file.exists(manfilename) = false then
            fileopen(1, manfilename, openmode.binary)
            fileput(1, "<?xml version='1.0' encoding='utf-8' standalone='yes'?>" & environment.newline)
            fileput(1, "<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestversion='1.0'>" & environment.newline)
            fileput(1, "<assemblyidentity version='1.0.0.0' processorarchitecture='x86' name='zx.exe' type='win32' />" & environment.newline)
            fileput(1, "<description>zxapplication</description>" & environment.newline)
            fileput(1, "<dependency>" & environment.newline)
            fileput(1, "<dependentassembly>" & environment.newline)
            fileput(1, "<assemblyidentity type='win32' name='microsoft.windows.common-controls' version='6.0.0.0' processorarchitecture='x86' publickeytoken='6595b64144ccf1df' language='*' />" & environment.newline)
            fileput(1, "</dependentassembly>" & environment.newline)
            fileput(1, "</dependency>" & environment.newline)
            fileput(1, "</assembly>" & environment.newline)
            fileclose(1)
        end if


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表