转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 软件开发 >> Delphi程序 >> 正文
网络小工具 ShareView         ★★★★

网络小工具 ShareView

作者:闵涛 文章来源:闵涛的学习笔记 点击数:8192 更新时间:2009/4/23 18:28:24

版权声明:

本文由Lyris完成,首发于CSDN,作者保留中文版权。
未经许可,不得使用于任何商业用途。
欢迎转载,但请保持文章及版权声明完整。
如需联络请发邮件:chenwentao@gmail.com


unit NetMonConsts;

interface

uses Windows;

type
  TShareInfo2 = packed record
    shi2_netname: PWChar;
    shi2_type: DWORD;
    shi2_remark: PWChar;
    shi2_permissions: DWORD;
    shi2_max_uses: DWORD;
    shi2_current_uses: DWORD;
    shi2_path: PWChar;
    shi2_passwd: PWChar;
  end;
  PShareInfo2 = ^TShareInfo2;
  TShareInfo2Array = array[0..512] of TShareInfo2;
  PShareInfo2Array = ^TShareInfo2Array;

type
  TShareInfo50 = packed record
    shi50_netname: array[0..12] of Char;
    shi50_type: Byte;
    shi50_flags: Word;
    shi50_remark: PChar;
    shi50_path: PChar;
    shi50_rw_password: array[0..8] of Char;
    shi50_ro_password: array[0..8] of Char;
  end;

type
  TSessionInfo502 = packed record
    Sesi502_cname: PWideChar;
    Sesi502_username: PWideChar;
    Sesi502_num_opens: DWORD;
    Sesi502_time: DWORD;
    Sesi502_idle_time: DWORD;
    Sesi502_user_flags: DWORD;
    Sesi502_cltype_name: PWideChar;
    Sesi502_transport: PWideChar;
  end;
  PSessionInfo502 = ^TSessionInfo502;
  TSessionInfo502Array = array[0..512] of TSessionInfo502;
  PSessionInfo502Array = ^TSessionInfo502Array;

type
  TSessionInfo50 = packed record
    Sesi50_cname: PChar;
    Sesi50_username: PChar;
    sesi50_key: Cardinal;
    sesi50_num_conns: Word;
    sesi50_num_opens: Word;
    sesi50_time: Cardinal;
    sesi50_idle_time: Cardinal;
    sesi50_protocol: Byte;
    pad1: Byte;
  end;

type
  TFileInfo3 = packed record
    fi3_id: DWORD;
    fi3_permissions: DWORD;
    fi3_num_locks: DWORD;
    fi3_pathname: PWChar;
    fi3_username: PWChar;
  end;
  PFileInfo3 = ^TFileInfo3;
  TFileInfo3Array = array[0..512] of TFileInfo3;
  PFileInfo3Array = ^TFileInfo3Array;

type
  TFileInfo50 = packed record
    fi50_id: Cardinal;
    fi50_permissions: WORD;
    fi50_num_locks: WORD;
    fi50_pathname: PChar;
    fi50_username: PChar;
    fi50_sharename: PChar;
  end;

type
  TMibIfRow = packed record
    wszName: array[0..255] of WideChar;
    dwIndex: DWORD;
    dwType: DWORD;
    dwMtu: DWORD;
    dwSpeed: DWORD;
    dwPhysAddrLen: DWORD;
    bPhysAddr: array[0..7] of Byte;
    dwAdminStatus: DWORD;
    dwOperStatus: DWORD;
    dwLastChange: DWORD;
    dwInOctets: DWORD;
    dwInUcastPkts: DWORD;
    dwInNUCastPkts: DWORD;
    dwInDiscards: DWORD;
    dwInErrors: DWORD;
    dwInUnknownProtos: DWORD;
    dwOutOctets: DWORD;
    dwOutUCastPkts: DWORD;
    dwOutNUCastPkts: DWORD;
    dwOutDiscards: DWORD;
    dwOutErrors: DWORD;
    dwOutQLen: DWORD;
    dwDescrLen: DWORD;
    bDescr: array[0..255] of Char;
  end;
  TMibIfArray = array[0..512] of TMibIfRow;
  PMibIfRow = ^TMibIfRow;
  PMibIfArray = ^TMibIfArray;

type
  TMibIfTable = packed record
    dwNumEntries: DWORD;
    Table: TMibIfArray;
  end;
  PMibIfTable = ^TMibIfTable;
var
  NetShareEnumNT: function(servername: PWChar;
    level: DWORD;
    bufptr: Pointer;
    prefmaxlen: DWORD;
    entriesread,
    totalentries,
    resume_handle: LPDWORD): DWORD; stdcall;

var
  NetShareEnum: function(pszServer: PChar;
    sLevel: Cardinal;
    pbBuffer: Pchar;
    cbBuffer: Cardinal;
    pcEntriesRead,
    pcTotalAvail: Pointer): DWORD; stdcall;

var
  NetShareDelNT: function(servername: PWideChar;
    netname: PWideChar;
    reserved: DWORD): LongInt; stdcall;

var
  NetShareDel: function(pszServer,
    pszNetName: PChar;
    usReserved: Word): DWORD; stdcall;

var
  NetShareAddNT: function(servername: PWideChar;
    level: DWORD;
    buf: Pointer;
    parm_err: LPDWORD): DWORD; stdcall;

var
  NetShareAdd: function(pszServer: Pchar;
    sLevel: Cardinal;
    pbBuffer: PChar;
    cbBuffer: Word): DWORD; stdcall;

var
  NetSessionEnumNT: function(servername,
    UncClientName,
    username: PWChar;
    level: DWORD;
    bufptr: Pointer;
    prefmaxlen: DWORD;
    entriesread,
    totalentries,
    resume_handle: LPDWORD): DWORD; stdcall;

var
  NetSessionEnum: function(pszServer: PChar;
    sLevel: DWORD;
    pbBuffer: Pointer;
    cbBuffer: DWORD;
    pcEntriesRead,
    pcTotalAvial: Pointer): integer; stdcall;

var
  NetSessionDelNT: function(ServerName,
    UncClientName,
    username: PWChar): DWORD; stdcall;

var
  NetSessionDel: function(pszServer: PChar;
    pszClientName: PChar;
    sReserved: SmallInt): DWORD; stdcall;

var
  NetFileEnumNT: function(servername,
    basepath,
    username: PWChar;
    level: DWORD;
    bufptr: Pointer;
    prefmaxlen: DWORD;
    entriesread,
    totalentries,
    resume_handle: LPDWORD): DWORD; stdcall;

var
  NetFileEnum: function(pszServer,
    pszBasePath: PChar;
    sLevel: DWORD;
    pbBuffer: Pointer;
    cbBuffer: DWORD;
    pcEntriesRead,
    pcTotalAvail: pointer): integer; stdcall;

var
  NetFileClose: function(ServerName: PWideChar;
    FileId: DWORD): DWORD; stdcall;

var
  NetFileClose2: function(pszServer: PChar;
    ulFileId: LongWord): DWORD; stdcall;

var
  GetIfTable: function(pIfTable: PMibIfTable;
    pdwSize: PULONG;
    bOrder: Boolean): DWORD; stdcall;

implementation

end.

unit NetMonUtils;

interface

uses Windows, Classes, NetMonConsts;

function IsNT(var Value: Boolean): Boolean;

procedure GetShares(SharesList: TStrings);
procedure CloseShare(ShareName: string);
procedure AddShare(ShareName, ShareDir: string);

procedure GetSessions(List: TStrings);
procedure CloseSession(SessionName: string);

procedure GetFiles(FilesList: TStrings);
procedure CloseFile(FileIndex: string);

procedure GetTrafficSets(TrafficsList: TStrings);

function IntegerToTimeStr(Value: Integer): string;

type
  TShareInfo2Obj = class
  private
    Fshi2_netname: string;
    Fshi2_path: string;
    procedure Setshi2_netname(const Value: string);
    procedure Setshi2_path(const Value: string);
  public
    constructor Create(ShareInfo2: TShareInfo2);
    property shi2_netname: string read Fshi2_netname write Setshi2_netname;
    property shi2_path: string read Fshi2_path write Setshi2_path;
  end;
  TShareInfo50Obj = class
  private
    Fshi50_netname: string;
    Fshi50_path: string;
    procedure Setshi50_netname(const Value: string);
    procedure Setshi50_path(const Value: string);
  public
    constructor Create(ShareInfo50: TShareInfo50);
    property shi50_netname: string read Fshi50_netname write Setshi50_netname;
    property shi50_path: string read Fshi50_path write Setshi50_path;
  end;
  TSessionInfo502Obj = class
  private
    FSesi502_Time: DWord;
    Fsesi502_idle_time: DWord;
    FSesi502_num_opens: DWord;
    FSesi502_cname: WideString;
    FSesi502_username: WideString;
    procedure SetSesi502_cname(const Value: WideStri

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ...  下一页 >> 


没有相关教程
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · C语言系列  · VB.NET程序
    · JAVA开发  · Delphi程序
    · 脚本语言
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台