functionunit.pas

来自「闭路电视收费系统」· PAS 代码 · 共 36 行

PAS
36
字号
unit FunctionUnit;

interface

uses
  Windows,Messages, SysUtils, Classes;

type
  RefClass = Class
  public
    IntegrateRate,StockRate,EduationRate,VideoRate:Integer;
  end;
    

function myComputerName:String;

implementation


function myComputerName: String;
var
   pcComputer : PChar;
   dwCSize    : DWORD;
begin
  dwCSize := MAX_COMPUTERNAME_LENGTH + 1;
  GetMem( pcComputer, dwCSize ); // allocate memory for the string
  try
    if Windows.GetComputerName( pcComputer, dwCSize ) then
      Result := pcComputer;
  finally
    FreeMem( pcComputer ); // now free the memory allocated for the string
  end;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?