文章分类 - 函数
摘要:function ExpCalc(exp: string): string; var vScript: Variant; begin vScript := CreateOleObject('ScriptControl'); vScript.Language := 'VBScript'; Result := vScript.Eval(exp); end; procedure TForm1.B...
阅读全文
摘要:[代码]//如果是汉字那么,返回 True,如果不是汉字,那么返回 Falsefunction IsMBCSChar(const ch: Char): Boolean; begin Result := (ByteType(ch, 1) <> mbSingleByte); end; 来源:http://www.delphitop.com/html/zifuchuan/322.html
阅读全文
摘要:作者: ivy1982标题: 繁简转换 关键字: 繁简转换 分类: 个人专区 密级: 公开 (评分: , 回复: 0, 阅读: 6) »» 繁简转换 关键字: 繁简转换 我根据VC++改的在两个操作环境下都测试能过//*****************************************************//Function BIG...
阅读全文
摘要:SQLServer下取拼音码的函数--drop function fun_getPYCreate function fun_getPY(@str nvarchar(4000)) returns nvarchar(4000) as begin declare @word nchar(1),@PY nvarchar(4000) set @PY='' while len(@str)>0 begin...
阅读全文
摘要:文件CRC32效验const Table: array[0..255] of DWORD = ($00000000, $77073096, $EE0E612C, $990951BA, $076DC419, $706AF48F, $E963A535, $9E6495A3, $0EDB8832, $79DCB8A4, $E0D5E91E, $97D2D988, $09B64C2B, $7EB17CB...
阅读全文
摘要://机内码 -> 汉字Function MacCode2Chinese(AiUniCode : Integer) : String;Var ch, cl : Integer;Begin ch := AiUniCode Div 256; cl := AiUniCode Mod 256; Result := Chr(ch) + Chr(cl);end;//汉字 -> 机内码Function...
阅读全文
摘要:delphi 编码转换 unicode gbk big5(转载)[ 2006-03-23 15:39:23 | 作者: Admin ] 字体大小: 大 | 中 | 小 以下代码在DELPHI 7上调试通过,主要使用了api函数中MultiByteToWidechar function UnicodeEncode(Str:string;CodePage:integer):WideString;var...
阅读全文
摘要:根据〖中华人民共和国国家标准 GB 11643-1999〗中有关公民身份号码的规定,公民身份号码是特征组合码18位:由十七位数字本体码和一位数字校验码组成。排列顺序从左至右依次为:六位数字地址码,八位数字出生日期码,三位数字顺序码和一位数字校验码。 地址码表示编码对象常住户口所在县(市、旗、区)的行政区划代码。生日期码表示编码对象出生的年、月、日,其中年份用四位数字表示,年、月、日之间不用分隔符。...
阅读全文
摘要:functionExecuteAndWaitProcess(constACmdLine : string;constACurrDir : string = ''):Boolean;varSI: TStartupInfo;PI: TProcessInformation;beginFillChar(SI, SizeOf(SI), 0);SI.cb := SizeOf(SI);SI.dwFlags :=...
阅读全文
摘要:Function isAscii(Nomefile: String): Boolean; constSett=2048;vari: Integer;F: file;a: Boolean;TotSize, IncSize, ReadSize: Integer;c: Array[0..Sett] of byte;beginIf FileExists(NomeFile) thenbegin{$I-}As...
阅读全文
摘要:关键词:文件状态 function IsFileInUse(FileName: TFileName): Boolean; var HFileRes: HFILE; begin Result := False; if not FileExists(FileName) then Exit; HFileRes := CreateFile(PChar(FileName), GENERIC_READ...
阅读全文
摘要:procedure Delay(msecs:integer);var Tick: DWord;Event: THandle;beginEvent := CreateEvent(nil, False, False, nil);try Tick := GetTickCount + DWord(msecs); while (msecs > 0) and (MsgWaitForMultipleObj...
阅读全文
摘要://二进制字符转十进制 Function binToDec(Value :string) : integer; VAR str : String; Int : Integer; i : integer; BEGIN Str := UpperCase(Value); Int := 0; FOR i := 1 TO Length(str) DO Int := Int * 2+ ORD(str[...
阅读全文
摘要:type TDynByteArray = array of byte;const SeedA = 5678; /// 常量,你可以修改 SeedB = 5432; /// 常量,你可以修改/// 对数组加密function Crypt(const s: TDynByteArray; Key: Word; const bEncrypt: boolean = true): TDynByteArray;...
阅读全文
摘要:function ExecAppWait(AppName, Params: string): Boolean; var ShellExInfo: TShellExecuteInfo; begin FillChar(ShellExInfo, SizeOf(ShellExInfo), 0); with ShellExInfo do begin cbSize := SizeOf(ShellExI...
阅读全文
摘要:const XorKey:array[0..7] of Byte=($B2,$09,$AA,$55,$93,$6D,$84,$47); //字符串加密用 function Enc(Str:String):String;//字符加密函數 這是用的一個異或加密 var i,j:Integer; begin Result:=''; j:=0; for i:=1 to Length(Str) do ...
阅读全文
摘要:分割函数1:function SplitString(Source, Deli: string ): TStringList;stdcall; var EndOfCurrentString: byte; StringList:TStringList; begin StringList:=TStringList.Create; while Pos(Deli, Source)>0 do begi...
阅读全文