找回密码
 注册

QQ登录

只需一步,快速开始

楼主: Fred

电脑高手必备

网络天 发表于 2006-11-16 18:15:31 | 显示全部楼层 来自 中国安徽合肥
能加钱吗
daotong 发表于 2006-11-16 21:10:56 | 显示全部楼层 来自 中国江苏宿迁
看看再说,不知道是什么。
cn123456 发表于 2006-11-18 07:40:33 | 显示全部楼层 来自 中国辽宁沈阳
是什么,写一下介绍
天天新 发表于 2006-11-19 18:00:34 | 显示全部楼层 来自 中国湖南株洲
okok
yanbinsdfg 发表于 2006-11-19 20:27:41 | 显示全部楼层 来自 中国四川自贡
想看看
姜华 发表于 2006-11-19 21:08:59 | 显示全部楼层 来自 中国河南新乡

现在什么都要钱啊!

就不能免费共享一下?
sbahko 发表于 2006-11-22 17:43:45 | 显示全部楼层 来自 中国河南商丘
我不分不够  不能下了
阿疯 发表于 2006-11-22 19:41:17 | 显示全部楼层 来自 中国福建莆田
kanxia
飞云天 发表于 2006-11-23 17:18:31 | 显示全部楼层 来自 中国广东
下几个才回一个
飞云天 发表于 2006-11-23 17:18:40 | 显示全部楼层 来自 中国广东
下几个才回一个我
玉米 发表于 2006-12-2 00:45:27 | 显示全部楼层 来自 中国江苏南通

unit Unit1;

unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, StdCtrls, ExtCtrls, Winsock; //首先要添加winsock
type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Label1: TLabel;
    PopupMenu1: TPopupMenu;
    Exit: TMenuItem;
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    procedure Label1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure ExitClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  oldx,oldy: integer;//添加变量,用做移动窗体
  oldIp: string;
implementation
{$R *.dfm}
//下面就是关键所在了
function LIP : string;
type
  TaPInAddr = array [0..10] of PInAddr;
  PaPInAddr = ^TaPInAddr;
var
  phe  : PHostEnt;
  pptr : PaPInAddr;
  Buffer : array [0..63] of char;
  I    : Integer;
  GInitData      : TWSADATA;
begin
  WSAStartup($101, GInitData);
  Result := '';
  GetHostName(Buffer, SizeOf(Buffer));
  phe :=GetHostByName(buffer);
  if phe = nil then Exit;
  pptr := PaPInAddr(Phe^.h_addr_list);
  I := 0;
  while pptr^[I] <> nil do begin
    result:=StrPas(inet_ntoa(pptr^[I]^));
    Inc(I);
  end;
  WSACleanup;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  with Label1 do  //定义属性
  begin
    Caption:='';
    Font.Charset:=ANSI_CHARSET;
    Font.Name:='Arial';
    Font.Size:=10;
    Font.Color:=clRed;
    Align:=alClient;
    PopupMenu:=popupmenu1;
  end;

  Timer1.Interval:=1000;
  Timer1.Enabled:=true;
  Label1.Caption:='IP:'+LIP; //赋值,把Ip赋值给label1
  oldIp:=LIP;
  BorderStyle:=bsNone;
  Alphablend:=true; //呵呵,这个就是让窗口变透明的办法了
  Alphablendvalue:=100;
  FormStyle:=fsStayOnTop; //让窗体总在最前面
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Label1.Caption :='IP:'+LIP;
  if oldip <> LIP then
    Showmessage('IP地址已经改变,请检查!');//提醒用户
end;

procedure TForm1.Label1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
  if ssleft in shift then  //移动窗体Form1
  begin
     Form1.Left:=Form1.Left+x-oldx;
     Form1.Top:=Form1.top+y-oldy;
  end;
end;

procedure TForm1.Label1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  oldx:=x;
  oldy:=y;
end;

procedure TForm1.ExitClick(Sender: TObject);
begin
  Close;
end;
end.
潇杨克 发表于 2006-12-2 19:13:11 | 显示全部楼层 来自 中国云南昆明
看看 谢了.
黑冰 发表于 2006-12-4 00:30:06 | 显示全部楼层 来自 中国黑龙江牡丹江
好东西要顶
hbdnweixiupc 发表于 2006-12-6 20:50:12 | 显示全部楼层 来自 中国辽宁沈阳
下下看。下下看。下下看。
疯狗 发表于 2006-12-8 11:38:09 | 显示全部楼层 来自 中国江苏苏州
下下看,再顶一下!
风无根人不定 发表于 2006-12-8 11:38:58 | 显示全部楼层 来自 中国广东广州
真的,假的,

看这就知。。

thanks
大马 发表于 2006-12-11 19:06:41 | 显示全部楼层 来自 中国河南焦作
能成高手吗?
修理学徒 发表于 2006-12-19 21:51:40 | 显示全部楼层 来自 中国浙江温州
下来看看~~`
苦地瓜 发表于 2007-1-12 20:25:28 | 显示全部楼层 来自 中国湖北襄阳
诱惑来临
张信 发表于 2007-1-18 21:26:12 | 显示全部楼层 来自 中国广东

看不到啊!!

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表