使用COM编写服务器代码,
那么在服务器端的程序中如何获得远程调用者的IP地址。
紧急求教,万分感谢!!!!!!

解决方案 »

  1.   

    俺觉得这是个不可完成的任务
    COM对象可以知道“自己”运行在哪里
    但无法知道调用者在哪里……帮你up,也许有其他的dx,尤其是masterz之类的老大们有办法!
      

  2.   

    有,我的同事用VB做过,
    首先要引用Microsoft Active Server Pages Object Libray和
    COM+ Service Type Library(win2000).
    //
        Dim request As request
        Dim objCtx As ObjectContext   'ObjectContext
        Dim strUrl As String
        Set objCtx = GetObjectContext()
        'Get references to the asp intrisics
        ' Set objRes = objCtx("Response")
        Set request = objCtx.Item("Request")
        Set objCtx = Nothing
        strUrl = request.ServerVariables("URL")
    //
    参考一下,用VC试试
      

  3.   

    IRequest接口在任意环境下都能得到吗?
    如果不能,那么楼上的代码只适用于asp环境吧
    如果是asp环境,干脆直接在asp代码中得到调用者的ip地址,然后传递给com对象好了