- Timestamp:
- Oct 10, 2011, 1:34:02 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/UCommon.pas
r260 r282 7 7 uses 8 8 {$IFDEF Windows}Windows,{$ENDIF} 9 Classes, SysUtils, SpecializedList, StrUtils, Dialogs, 9 Classes, SysUtils, SpecializedList, StrUtils, Dialogs, Process, 10 10 FileUtil; //, ShFolder, ShellAPI; 11 11 … … 36 36 {$ENDIF} 37 37 38 function IntToBin(Data: Cardinal; Count: Byte): string; 38 function IntToBin(Data: Int64; Count: Byte): string; 39 function BinToInt(BinStr: string): Int64; 39 40 function TryHexToInt(Data: string; var Value: Integer): Boolean; 40 41 function TryBinToInt(Data: string; var Value: Integer): Boolean; … … 59 60 procedure FileDialogUpdateFilterFileType(FileDialog: TOpenDialog); 60 61 procedure DeleteFiles(APath, AFileSpec: string); 62 procedure OpenWebPage(URL: string); 61 63 62 64 63 65 implementation 66 67 function BinToInt(BinStr : string) : Int64; 68 var 69 i : byte; 70 RetVar : Int64; 71 begin 72 BinStr := UpperCase(BinStr); 73 if BinStr[length(BinStr)] = 'B' then Delete(BinStr,length(BinStr),1); 74 RetVar := 0; 75 for i := 1 to length(BinStr) do begin 76 if not (BinStr[i] in ['0','1']) then begin 77 RetVar := 0; 78 Break; 79 end; 80 RetVar := (RetVar shl 1) + (byte(BinStr[i]) and 1) ; 81 end; 82 83 Result := RetVar; 84 end; 64 85 65 86 function BinToHexString(Source: AnsiString): string; … … 179 200 end;*) 180 201 181 function IntToBin(Data: Cardinal; Count: Byte): string;202 function IntToBin(Data: Int64; Count: Byte): string; 182 203 var 183 204 I: Integer; … … 344 365 end; 345 366 367 procedure OpenWebPage(URL: string); 368 var 369 Process: TProcess; 370 Browser, Params: string; 371 begin 372 try 373 Process := TProcess.Create(nil); 374 Browser := ''; 375 //FindDefaultBrowser(Browser, Params); 376 //Process.Executable := Browser; 377 //Process.Parameters.Add(Format(Params, [ApplicationInfo.HomePage]); 378 Process.Executable := 'cmd.exe'; 379 Process.Parameters.Add('/c'); 380 Process.Parameters.Add('start'); 381 Process.Parameters.Add(URL); 382 Process.Options := [poNoConsole]; 383 Process.Execute; 384 finally 385 Process.Free; 386 end; 387 end; 388 346 389 347 390 initialization
Note:
See TracChangeset
for help on using the changeset viewer.