当前位置: 首页 > news >正文

做家装网站客户来源多吗谷歌seo和百度seo

做家装网站客户来源多吗,谷歌seo和百度seo,网页设计阶段,怎么弄公众号我们知道编程的时候使用代理服务器并不是一件爽心悦目的事情,可是很多时候又是迫不得已的。微软在.NET Framework得System.Net名称空间里给我们提供了一个WebProxy类,不过这是一个http代理,这种代理使用起来受限太多,很不方便。如…

    我们知道编程的时候使用代理服务器并不是一件爽心悦目的事情,可是很多时候又是迫不得已的emsad.gif。微软在.NET Framework得System.Net名称空间里给我们提供了一个WebProxy类,不过这是一个http代理,这种代理使用起来受限太多,很不方便。如果我们需要访问更多的网络服务,socks代理是一个理想的选择。下面是C#编写的一个匿名socks5代理使用示例:

ContractedBlock.gifExpandedBlockStart.gif连接匿名socks5服务器代码#region 连接匿名socks5服务器代码
InBlock.gif
private bool ConnectProxyServer(string strRemoteHost, int iRemotePort, Socket sProxyServer)
ExpandedSubBlockStart.gifContractedSubBlock.gif
dot.gif{
InBlock.gif    
//构造Socks5代理服务器第一连接头(无用户名密码)
InBlock.gif
    byte[] bySock5Send = new Byte[10];
InBlock.gif    bySock5Send[
0= 5;
InBlock.gif    bySock5Send[
1= 1;
InBlock.gif    bySock5Send[
2= 0;
InBlock.gif
InBlock.gif    
//发送Socks5代理第一次连接信息
InBlock.gif
    sProxyServer.Send(bySock5Send, 3, SocketFlags.None);
InBlock.gif
InBlock.gif    
byte[] bySock5Receive = new byte[10];
InBlock.gif    
int iRecCount = sProxyServer.Receive(bySock5Receive, bySock5Receive.Length, SocketFlags.None);
InBlock.gif
InBlock.gif    
if ( iRecCount<2 ) 
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        sProxyServer.Close();
InBlock.gif        
throw new Exception("不能获得代理服务器正确响应。");
ExpandedSubBlockEnd.gif    }

InBlock.gif
InBlock.gif    
if ( bySock5Receive[0]!=5 || ( bySock5Receive[1]!=0 && bySock5Receive[1]!=2 ) )
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        sProxyServer.Close(); 
InBlock.gif        
throw new Exception("代理服务其返回的响应错误。");
ExpandedSubBlockEnd.gif    }

InBlock.gif
InBlock.gif    
if ( bySock5Receive[1]==0 )
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        bySock5Send[
0= 5;
InBlock.gif        bySock5Send[
1= 1;
InBlock.gif        bySock5Send[
2= 0;
InBlock.gif        bySock5Send[
3= 1;
InBlock.gif
InBlock.gif        IPAddress ipAdd 
= Dns.Resolve(strRemoteHost).AddressList[0];
InBlock.gif        
string strIp = ipAdd.ToString();
ExpandedSubBlockStart.gifContractedSubBlock.gif        
string []strAryTemp = strIp.Split(new char[] dot.gif{'.'});
InBlock.gif        bySock5Send[
4= Convert.ToByte(strAryTemp[0]);
InBlock.gif        bySock5Send[
5= Convert.ToByte(strAryTemp[1]);
InBlock.gif        bySock5Send[
6= Convert.ToByte(strAryTemp[2]);
InBlock.gif        bySock5Send[
7= Convert.ToByte(strAryTemp[3]);
InBlock.gif
InBlock.gif        bySock5Send[
8= (byte)(iRemotePort/256);
InBlock.gif        bySock5Send[
9= (byte)(iRemotePort%256);
InBlock.gif
InBlock.gif        sProxyServer.Send(bySock5Send, bySock5Send.Length, SocketFlags.None);
InBlock.gif        iRecCount 
= sProxyServer.Receive(bySock5Receive, bySock5Receive.Length, SocketFlags.None);
InBlock.gif
InBlock.gif        
if ( bySock5Receive[0]!=5 || bySock5Receive[1]!=0 )
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            sProxyServer.Close();
InBlock.gif            
throw new Exception("第二次连接Socks5代理返回数据出错。");
ExpandedSubBlockEnd.gif        }

InBlock.gif        return true ;
ExpandedSubBlockEnd.gif    }

InBlock.gif    
else
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
if ( bySock5Receive[1]==2 ) 
InBlock.gif            
throw new Exception("代理服务器需要进行身份确认。");
InBlock.gif        
else return false ;
ExpandedSubBlockEnd.gif    }

ExpandedSubBlockEnd.gif}

ExpandedBlockEnd.gif
#endregion

   关于socks5代理的详细文档,可以参看RFC 1928。

   使用上面的代码需要有一个匿名的socks5代理服务器,然后调用:

None.gifprivate Socket GetSocket(string strIpAdd, int iPort)
ExpandedBlockStart.gifContractedBlock.gif
dot.gif{
InBlock.gif    IPAddress hostadd 
= Dns.Resolve(strIpAdd).AddressList[0];
InBlock.gif    IPEndPoint EPhost 
= new IPEndPoint(hostadd, iPort);
InBlock.gif    Socket s 
= new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
InBlock.gif    s.Connect(EPhost);
InBlock.gif    
return s ;
ExpandedBlockEnd.gif}

None.gif
None.gifsRemoteHost 
= GetSocket(proxyHost, proxyProt);
None.gifConnectProxyServer(
"61.135.134.24"80
, sRemoteHost);
None.gif

   如果您需要使用非匿名的socks5代理,把RFC 1928后面关于用户验证的部分实现就可以了,由于我使用的都是匿名的socks5代理,所以没有做这个部分得工作emembarrassed.gif

http://www.lbrq.cn/news/2473435.html

相关文章:

  • 创建全国文明城市建议简短seo是什么字
  • 顺德品牌网站青岛seo服务哪家好
  • 阿里巴巴中文站官网seo网络营销推广公司
  • 广平手机网站建设标题优化
  • 东莞微信网站上海网站seo策划
  • 动态ip网站如何备案此网站服务器不在国内维护
  • 做个网站多少钱 百度能查到的爱站网长尾关键词
  • 武安市网站建设费用百度搜索引擎推广
  • 如何做自己的在线作品网站软文关键词排名推广
  • 杭州网站建设多少钱抖音关键词排名优化
  • 广州网站建设广州网络推广公司百度小说排行榜总榜
  • 渭南华阴建设银行的网站是多少上海比较大的优化公司
  • 关于做代购网站的纳税知识cba最新排名
  • 网页兼容性站点如何做seo整站优化
  • 南京有哪些做网站的公司上海seo推广
  • 网站建设logo中囯联通腾迅
  • 个人网站首页布局设计百度一下首页手机版
  • 石家庄专业做网站公司营销网络推广方式有哪些
  • 源码网站开发seo技术服务外包
  • 全网网站建设seo搜索引擎优化案例
  • 苏州知名网站建设设计公司企业网址怎么注册
  • 网站建设吗产品推广方案范例
  • 室内设计在哪里接网单推推蛙seo顾问
  • 网站建设与管理的考试上海推广外包
  • 苍南网站建设个人如何推广app
  • 建设田达摩托车官方网站免费的seo
  • 三级a一级a做爰视频免费网站搜索引擎是网站吗
  • 关键词排名优化网站建设公司哪家好线上营销方式6种
  • 假网站怎么做呢大学生网页设计主题
  • 低价网站建设多少钱如何利用网络广告进行推广
  • openmv特征点检测
  • 如何查看电脑后门IP和流量?
  • RS485转Profinet网关配置指南:高效启动JRT激光测距传感器测量模式
  • 【Spring WebFlux】为什么 Spring 要拥抱响应式
  • C++ 常用的数据结构(适配器容量:栈、队列、优先队列)
  • 【RDMA】Adapters PRM Mellanox Adapters Programmer’s Reference mellanox网卡编程手册0.52