您的位置:程序门 -> vb -> 网络编程



adsl+花生壳 的winsock传输问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


adsl+花生壳 的winsock传输问题
发表于:2008-02-13 16:46:03 楼主
家里服务器用电信adsl连接上internet,用花生壳申请域名,例如域名为ioray2008.vicp.net     现在想用单位的电脑连接服务器
程序怎么编写     winsock.remoteip的属性能否直接写域名呢   也就是     winsock.remotei=ioray2008.vicp.net     如果可以
winsock.remoteport怎么填写,采用tcp方式     ,服务器上运行   监听程序     winsockser.localip=本机名   winsockser.localport=6000,     客户端winsock是否应该这样设置     winsock.remoteip=ioray2008.vicp.net  
winsock.remoteport=6000,然后winsock.accept就可以了

请大家给点意见,先看这种方式是否可行,另外看看winsock设置是否正确,多谢大家
发表于:2008-02-13 19:36:261楼 得分:0
既然是有域名,为何不是用ie去连接呢?
发表于:2008-02-14 10:38:292楼 得分:0
to   wallescai:   我要传输数据的啊
发表于:2008-02-14 12:16:333楼 得分:0
lz设置很复杂........我一般也就是设服务端的localport就可以了.......
客户端用代码

winsock1.connect   花生壳申请的域名,服务端设好的port

就连接上了
发表于:2008-02-14 15:09:194楼 得分:0
好象没有这个必要,远程桌面结合ftp,就可以了。
发表于:2008-02-15 09:28:155楼 得分:0
to   tzwsoho:请问设置花生壳的方法,还有就是电信和网通的adsl设置一样吗
发表于:2008-02-15 11:57:086楼 得分:0
我是网通+路由的,可以用
发表于:2008-02-15 14:01:257楼 得分:0
我使用域名转ip的方法实现的。
public   function   getip(strremotehostip   as   string)   as   string
            dim   hostent_addr           as   long
            dim   host           as   hostent
            dim   hostip_addr           as   long
            dim   temp_ip_address()           as   byte
            dim   i           as   integer
            dim   ip_address           as   string
               
            hostent_addr   =   gethostbyname(strremotehostip)
               
            if   hostent_addr   =   0   then
                        getip   =   ""                                 '                                                               注释:主机名不能被解释
                        exit   function
            end   if
               
            rtlmovememory   host,   hostent_addr,   lenb(host)
            rtlmovememory   hostip_addr,   host.haddrlist,   4
               
            redim   temp_ip_address(1   to   host.hlength)
            rtlmovememory   temp_ip_address(1),   hostip_addr,   host.hlength
               
            for   i   =   1   to   host.hlength
                        ip_address   =   ip_address   &   temp_ip_address(i)   &   "."
            next
            ip_address   =   mid$(ip_address,   1,   len(ip_address)   -   1)
               
            getip   =   ip_address

end   function
使用方法:
if   text1.text   <>   ""   then   wskclient.remotehost   =   getip(strremotehostip)
if   text2.text   <>   ""   then   wskclient.remoteport   =   text2.text
发表于:2008-02-16 09:24:118楼 得分:0
带图的设置方法:
http://www.magicwinmail.com/technic_dnip_peanut.htm
不带图的,不过简单易懂:
http://zhidao.baidu.com/question/16933101.html


快速检索

最新资讯
热门点击