可以考虑这样的解决办法:
1.在程序中要用到路径的地方同意用相对路径,不要用绝对路径;
2.如果非要用绝对路径,需要读注册表,在注册表中可以找到用户的安装路径。

解决方案 »

  1.   

    http://www.csdn.net/develop/read_article.asp?id=18996
    VB:
    Dim FullPath As String
            Dim Asm As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
            Dim strConfigLoc As String
            strConfigLoc = Asm.Location
            Dim strTemp As String
            strTemp = strConfigLoc
    '提取安装路径
            strTemp = strTemp.Remove(strTemp.LastIndexOf("\"), Len(strTemp) - strTemp.LastIndexOf("\"))