• 网络学院
  • IT资讯
  • 操作系统
  • 网络技术
  • 软件应用
  • 办公软件
  • 编程技术
  • 网站架设
  • 数据库类
  • 平面设计
  • 多媒体类
  • 游戏资讯
  • 教学论文
  • 认证考试
用Delphi检测IE使用的代理服务器
  站点:
  • 首 页
  • 最新软件
  • 文章教程
  • 国内软件
  • 国外软件
  • 绿色软件
  • 源码下载
  • 字体下载
用Delphi检测IE使用的代理服务器
软件发布 用Delphi检测IE使用的代理服务器
网络软件 系统工具 应用软件 联络聊天 图形图像 多媒体类 行业软件 游戏娱乐 编程开发 安全相关 教育教学 数码软件 绿软下载
热门软件: QQ 瑞星 pplive e话通 木马克星 千千静听 office2000 五笔字根 Photoshop 视频分割
返回文章教程首页 >> 文章首页 >> 编程技术 >> Delphi教程 >> 用Delphi检测IE使用的代理服务器

用Delphi检测IE使用的代理服务器

添加时间: 2006-2-25 5:08:19  作者: Delphi教程  阅读次数:71   来源: http://www.d9soft.com

        如果我们开发的对象,不是在公网的环境内上网,是使用内网的,我们应该怎么样检测你的IE使用的代理服务器呢?接下来我们通过以下实例来学习:
  

  //-----------------------------------------------
  //记得引用 WinInet 单元
  //-----------------------------------------------
  uses
  WinInet

  //----------------------------------------------
  //定义要使用的函数
  //----------------------------------------------

  function GetProxyInformation: string;
  var
  ProxyInfo: PInternetProxyInfo;
  Len: LongWord;
  begin
  Result := '';
  Len := 4096;
  GetMem(ProxyInfo, Len);
  try
  if InternetQueryOption(nil, INTERNET_OPTION_PROXY, ProxyInfo, Len) then
  if ProxyInfo^.dwAccessType = INTERNET_OPEN_TYPE_PROXY then
  begin
  Result := ProxyInfo^.lpszProxy
  end;
  finally
  FreeMem(ProxyInfo);
  end;
  end;

  procedure GetProxyServer(protocol: string; var ProxyServer: string;
  var ProxyPort: Integer);
  var
  i: Integer;
  proxyinfo, ps: string;
  begin
  ProxyServer := '';
  ProxyPort := 0;

  proxyinfo := GetProxyInformation;
  if proxyinfo = '' then
  Exit;

  protocol := protocol + '=';

 


  i := Pos(protocol, proxyinfo);
  if i > 0 then
  begin
  Delete(proxyinfo, 1, i + Length(protocol));
  i := Pos(';', ProxyServer);
  if i > 0 then
  proxyinfo := Copy(proxyinfo, 1, i - 1);
  end;

  i := Pos(':', proxyinfo);
  if i > 0 then
  begin
  ProxyPort := StrToIntDef(Copy(proxyinfo, i + 1, Length(proxyinfo) - i), 0);
  ProxyServer := Copy(proxyinfo, 1, i - 1)
  end
  end;
  //----------------------------------------------------------------
  //使用范例
  //----------------------------------------------------------------
  procedure TForm1.Button1Click(Sender: TObject);
  var
  ProxyServer: string;
  ProxyPort: Integer;
  begin
  GetProxyServer('http', ProxyServer, ProxyPort);
  if  ProxyPort=0 then
  begin
  ShowMessage('你的IE没有使用的代理服务器')
  end
  else
  Label1.Caption := ProxyServer;
  label2.Caption := IntToStr(ProxyPort);

  end;

 

上下文章:

 

上一篇文章: 浅谈Delphi如何控制Excel操作 下一篇文章: Delphi学习:查句柄知多少

相关文章:

  • 用端口碰撞技术实现服务器远程管理
  • 以MDaemon为例解释邮件服务器的安全设置
  • 用Windows Server 2003架设小型邮件服务器
  • 用CMailServer打造邮件服务器
  • 你的email服务器准备好应对账号搜集攻击了吗

相关软件:

  • 北信源VRV 网络服务器端病毒库 90e
  • 全国计算机等级考试模拟软件(2006年全年使用)二级Visual Basic V9.0
  • 勤哲Excel服务器 2005 V6.0 企业版客户端
  • 勤哲Excel服务器 2005 V6.0 企业版服务器端
  • 勤哲Excel服务器 2005 V5.8.3 完整标准版
  • 勤哲Excel服务器 2005 V6.0 标准版

 

快速导航

  • 网络学院
  • 精品汇聚
  • 字体下载
  • 教程下载
  • ASP源码
  • PHP源码
  • Net源码
  • JSP 源码

编程技术分类导航

  • ASP & ASP.NET教程
  • PHP教程
  • JSP教程
  • C/C++教程
  • VB & VB.NET教程
  • VC教程
  • Delphi教程
  • BCB教程
  • VFP教程
  • PB教程
  • JAVA教程
  • XML教程
  • C#教程
  • CGI教程

本类经典文章推荐

  • Delphi的两个实用技巧(1)播放Flash
  • Delphi的两个实用技巧(2)巧用Wind...
  • delphi实例编程之--制作可随处拖放...
  • 关于VisiBroker For Delphi的使用...
  • 关于VisiBroker For Delphi的使用...
  • 关于VisiBroker For Delphi的使用...
  • 在线播放器DIY
  • Delphi让你发送Flash电子邮件
  • 在窗口标题区添加按钮
  • 用Delphi 6编程实现自动标注汉语拼...

Delphi教程阅读排行

  • Delphi7从入门到精通之历数Delphi...
  • Delphi的两个实用技巧(1)播放Flash
  • Delphi7从入门到精通之认识Delphi...
  • delphi实例编程之--制作可随处拖放...
  • Delphi控件,我们也可以(1)
  • Delphi的两个实用技巧(2)巧用Wind...
  • 在线播放器DIY
  • Delphi控件,我们也可以(2)
  • Spcomm串口控件的例程
  • 用Delphi + DirectX开发简单RPG游...

编程技术阅读总排行

  • VB入门教程之一
  • Java连接数据库实例
  • 第二章 PowerBuilder 入门之创建新...
  • VC++之List Box/Check List Box控...
  • 第一章 什么是PowerBuilder
  • VC++ List Ctrl控件
  • VC++ Combo Box/Combo Box Ex控件
  • 学C++不得不看的一篇文章
  • VB入门教程之二
  • VC++之Button控件

广告位置

字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 回到顶部

关于我们 | 版权声明 | 免责条款 | 广告联系 | 软件发布 | 下载帮助 | 下载排行 | 网站地图 | 特别鸣谢 | 友情连接

copyright; 2005-2008 D9soft.com 第九软件网 版权所有