当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: unit Main; interface uses S
 

 

    摘要:unit officeform; interface uses sysutils, windows, messages, classes, graphics, controls, forms, dbctrls, stdctrls, dbtables, extctrls, mask, db, dialogs, excel97, word97, oleserver; type t......
 ·delphi在局域网中的一则应用    »显示摘要«
    摘要:作者: 周勇 如果您是一位局域网的系统管理员的话,肯定要经常对连接在局域网中的各个工作组进行管理和维修,并对每一台工作组建立相关的信息档案,以后只要根据这些档案信息就知道对应的工作组的运行情况,从而可以大大提高管理的效率了。此时,可能有人说,要查看这些工作组的信息,不是还要一台一台地打开、一台一台地查看吗?的确,如果还是这样操作的话,工作效率肯定还是不会提高,那么我们有没有办法同时获取局域网中的......


如何用delphi读取网卡物理号
unit main;

【程序编程相关:Delphi中用Adsi创建IIS虚拟目

【推荐阅读:DELPHI超级Internet控件集-

interface 【扩展信息:DELPHI图形编辑技巧二则

uses

  sysutils, wintypes, winprocs, messages, classes, graphics, controls,

  forms, dialogs, stdctrls,

  nb, extctrls;

type

  tform1 = class(tform)

    panel1: tpanel;

    memo1: tmemo;

    panel2: tpanel;

    button1: tbutton;

    procedure button1click(sender: tobject);

    procedure formcreate(sender: tobject);

  private

    { private declarations }

  public

    { public declarations }

  end;

var

  form1: tform1;

implementation

{$r *.dfm}

{---------------------------------------------}

{ enumerate the lanas  - works only on win32 }

{---------------------------------------------}

function nblanaenum: tlana_enum;

var

  ncb: tncb;

  l_enum: tlana_enum;

  retcode: word;

begin

{$ifdef win32}

  fillchar(ncb, sizeof(ncb), 0);

  fillchar(l_enum, sizeof(tlana_enum), 0);

  ncb.command := ncb_enum;

  ncb.buf := @l_enum;

  ncb.length := sizeof(l_enum);

  retcode := netbioscmd(ncb);

  if retcode <> nrc_goodret then begin

    l_enum.length := 0;

    l_enum.lana[0] := byte(retcode);

  end;

{$else}                     { not supported for win16, fake lana 0 }

  l_enum.length := 1;

  l_enum.lana[0] := 0;

{$endif}

  result := l_enum;

end;

{----------------------------------------}

{ reset the lana - dont for win16 !     }

{----------------------------------------}

function nbreset(l: byte): word;

var

  ncb: tncb;

begin

{$ifndef win32}             { will reset all your connections for win1

6 }

  result := nrc_goodret;    { so just fake a reset for win16          

  }

{$else}

  fillchar(ncb, sizeof(ncb), 0);

  ncb.command := ncb_reset;

  ncb.lana_num := l;

  result := netbioscmd(ncb);

{$endif}

end;

{----------------------------------------}

{ return the mac address of an interface }

{ in the form of a string like :         }

{ xx:xx:xx:xx:xx:xx                    }

{ using the definitions in nb.pas        }

{----------------------------------------}

function nbgetmacaddr(lananum: integer): string;

var

  ncb: tncb;

  adpstat: tadpstat;

  retcode: word;

begin

  fillchar(ncb, sizeof(ncb), 0);

  fillchar(adpstat, sizeof(adpstat), 0);

  ncb.command := ncb_adpstat;

  ncb.buf := @adpstat;

  ncb.length := sizeof(adpstat);

  fillchar(ncb.callname, sizeof(tnbname), $20);

  ncb.callname[0] := byte(*);

  ncb.lana_num := lananum;

  retcode := netbioscmd(ncb);

  if retcode = nrc_goodret then begin

    result := format(%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x,

                   [adpstat.id[0],

                   adpstat.id[1],

                   adpstat.id[2],


...   下一页
    摘要:何章梅 delphi作为快速开发windows95/nt下应用程序的工具,已经为越来越多的开发者采用。但是,如果要开发出专业的windows应用软件,还需要使用大量的windows api函数,以下是笔者开发管理软件中的几个应用实例。 一、判定windows版本 众所周知,windows95/nt某些地方有些差别,为了使应用程序避免出现因为系统不符合而导致的错误,有必要自动判定系统版......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE