可不可以实现这样的程序,在客户端安装完后(带VBR),运行一个VB程序,通过这个程序的配置,客户端自动连接到中间层上了。

解决方案 »

  1.   

    客户端自动连接到中间层上了。
    //什么样的中间层?假如是你自己制作!做个配置界面,把配置信息存到注册表或者INI文件中!然后在中间层读取这些信息再工作!
      

  2.   

    新建一个ActivexDll的工程,添加一个Form,在Class内添加使其Show的代码例如
    public sub ShowConfigForm()
        Form1.Show
    end sub然后在Form1作保存到注册表,最后在Class再定义读取注册表,
    关于注册表的操作,参见:
    http://www.sqreg.com/file/vb/reg_01.htm
      

  3.   

    要把什么信息保存到注册表呀?把VBR的吗?我还是不明白
      

  4.   

    我想还是把配置信息放到INI中好一些,可是要放哪些信息呀?谁能告诉我呀
      

  5.   

    看看这个
    vbr文件注册方法:clireg32.exe xxx.vbr -t xxx.tlb -d -s 服务器名 -q -nologo
    注销用:regsvr32.exe xxx.vbr –u
      

  6.   

    你客户端要使用哪些配制信息 就放那些信息啊
    譬如 我需要设置客户端的标题
    然后可以在 ini文件里这样放:
    [SETTINGS]
    TITLE="工程1"然后在客户端读取TITLE
    然后me.caption=strTitle另外使用ini的api:
    Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
    Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
    Declare Function WritePrivateProfileSection Lib "kernel32" Alias "WritePrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpString As Any, ByVal lpFileName As String) As Long