วันศุกร์ที่ 9 มกราคม พ.ศ. 2558

FmSoft Unigui 0.96 and Extensions Full Download

FmSoft Unigui 0.96 and Extensions Full Download

License

Google Search String: Inno Setup Unpacker v.0.40

Rename fmsoft_unigui_beta_0.96.0.1065_setup.exe to fmsoft.exe
Start  Inno Setup Unpacker with cmd.exe
Unpack with following string: innounp fmsoft.exe -x
Create uniCoreXRES.txt ....fill out with any numbers and copy to Folder uniGUI.

วันอาทิตย์ที่ 21 ธันวาคม พ.ศ. 2557

image to save database

Procedure SaveImageToDB(FileName : String);
var tmpGraphic : TGraphic;
tmpBMP : TBitmap;
ExtFile : String;
begin
if FileExists(FileName) then
begin
ExtFile := LowerCase(ExtractFileExt(FileName));
Try
if ExtFile = '.jpg' then
tmpGraphic := TJpegimage.Create
else
if ExtFile = '.gif' then
tmpGraphic := TGIFImage.Create
else
if ExtFile = '.png' then
tmpGraphic := TPngImage.Create
else
tmpGraphic := TBitmap.Create;
// Loadfromfile
tmpGraphic.LoadFromFile(FileName);
tmpBMP := TBitmap.Create;
tmpBMP.Assign( tmpGraphic );
// Assign To BlobField ส่งให้ Blob ตรงๆ
TBLobfield(fDataLink.Dataset.FieldByName(FDatalink.FieldName)).Assign(tmpBMP);
// Assign To DBImage ส่งให้ DBImage ไม่ต้องการ tmpBMP
//DBImage_Display.Picture.Bitmap.Assign(tmpGraphic) ;
Finally
FreeAndNil(tmpGraphic);
FreeAndNil(tmpBMP);
End;
end;
end;

วันจันทร์ที่ 15 ธันวาคม พ.ศ. 2557

วันเสาร์ที่ 6 ธันวาคม พ.ศ. 2557

function MSecToTime(mSec: Integer): string;

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DBXDataSnap, IPPeerClient,
  Data.DBXCommon, Vcl.Grids, Vcl.DBGrids, Datasnap.DBClient, Datasnap.DSConnect,
  Data.DB, Data.SqlExpr, Vcl.StdCtrls ,midaslib
  ;

type
  TForm4 = class(TForm)
    ClientDataSet1: TClientDataSet;
    DataSource1: TDataSource;
    SQLConnection1: TSQLConnection;
    DSProviderConnection1: TDSProviderConnection;
    DBGrid1: TDBGrid;
    Edit1: TEdit;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form4: TForm4;

implementation

{$R *.dfm}

function MSecToTime2(mSec: Int64): string;
var
dt : TDateTime;
begin
dt
:=
mSec / MSecsPerSec / SecsPerDay;
Result
:=
Format('%d days, %s', [Trunc(dt),
FormatDateTime('hh:nn:ss.z', Frac(dt))]) ;
end;

function MSecToTime(mSec: Integer): string;
   const
     secondTicks = 1000;
     minuteTicks = 1000 * 60;
     hourTicks = 1000 * 60 * 60;
     dayTicks = 1000 * 60 * 60 * 24;
   var
      D, H, M, S: string;
      ZD, ZH, ZM, ZS: Integer;
   begin
      ZD := mSec div dayTicks;
      Dec(mSec, ZD * dayTicks) ;
      ZH := mSec div hourTicks;
      Dec(mSec, ZH * hourTicks) ;
      ZM := mSec div hourTicks;
      Dec(mSec, ZM * minuteTicks) ;
      ZS := mSec div secondTicks;
      D := IntToStr(ZD) ;
      H := IntToStr(ZH) ;
      M := IntToStr(ZM) ;
      S := IntToStr(ZS) ;
      Result := D + '.' + H + ':' + M + ':' + S;
   end;

procedure TForm4.Button1Click(Sender: TObject);
var
  start, stop, elapsed : cardinal;
begin
  start := GetTickCount;   //TimeOutThis();

    ClientDataSet1.Close;
    ClientDataSet1.CommandText := Edit1.Text;
    ClientDataSet1.Open;

     stop := GetTickCount;
  elapsed := stop - start; //milliseconds
  ShowMessage(MSecToTime(elapsed));
 ShowMessage(MSecToTime2(elapsed));

end;

end.

วันอาทิตย์ที่ 30 พฤศจิกายน พ.ศ. 2557

Delphi XE7 การเขียนโปรแกรมอ่านบัตรประชาชน ภายใน 3 นาที

Delphi XE7 การเขียนโปรแกรมอ่านบัตรประชาชน ภายใน 3 นาที


https://www.youtube.com/watch?v=6h8SUOWItBY


http://www.infintuary.org/stpcsc.php



คอมโพเนนท์ อ่านข้อมูล จากบัตรประชาชนคนไทย
** เฉพาะบัตรที่เป็นสมาร์การ์ด ไม่สนใจเวอร์ชั่น **
สำหรับ เดลไฟ XE7 Update 1 ( เดลไฟอื่น ไม่ได้ทดสอบ )
พัฒนา โดย วรเพชร  เรืองพรวิสุทธิ์

ความสามารถ
* อ่านข้อมูล ได้ทุกฟิลด์ ในส่วนของข้อมูล ที่เปิดเผย *

http://www.mediafire.com/download/60p3jiy2kwkfay6/Component_%E0%B8%AD%E0%B9%88%E0%B8%B2%E0%B8%99%E0%B8%9A%E0%B8%B1%E0%B8%95%E0%B8%A3%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B8%8A%E0%B8%B2%E0%B8%8A%E0%B8%99_10-12-2557_XE7.rar

วิธีใช้งานเบื้องต้น
============
https://www.youtube.com/watch?v=6h8SUOWItBY

1. วางคอมโพเนนท์ลงบนฟอร์ม ทั้ง 2 ตัว
2. สั่งคอมโพเนนท์ .open;
- เมื่อไดร์เวอร์พร้อม และ เครื่องพร้อม คอมโพเนนท์จะจัดการให้เอง

OnStatusChange  เมื่อสถานะเปลี่ยน
OnReadTextFinish  เมื่ออ่านข้อมูล ที่เป็นตัวอักษรเสร็จ
 ** เราสามารถกำหนด ได้ว่า จะอ่านรูปถ่ายหรือไม่
OnReadFinish  เมื่ออ่านข้อมูลตัวอักษร และ รูปภาพ เสร็จเรียบร้อย

Datas คือ Record

TSMCThaiData = record
    Person_CID      ,
    Person_Sex      ,
    Person_TitleTH  ,
    Person_FNameTH  ,
    Person_MiddleTH ,
    Person_LNameTH  ,
    Person_TitleEN  ,
    Person_FNameEN  ,
    Person_MiddleEN ,
    Person_LNameEN  : String;

    Person_Birth : TDateTime;
    Card_SDate : TDateTime;
    Card_EDate : TDateTime;
    Person_Religion  : String;
    Card_Barcode     : String;
    Card_Creator     : String;

    Address_1        : String;
    Address_2        : String;
    Address_3        : String;
    Address_4        : String;
    Address_5        : String;
    Address_6        : String;
    Address_7        : String;
    Address_8        : String;
    Address_9        : String;
    Addr_TambolName  : String;
    Addr_AmpurName   : String;
    Addr_ChangwatName: String;

    TextForDisplay   : TStringList;
    TextRawData      : String;
    Photo            : TImage;
    PhotoFileName    : String;
  end;

Datas.TextForDisplay   จะได้ข้อมูลตัวอักษรทั้งที่พร้อมจะแสดง
Datas.Person_CID จะได้เลขที่บัตรประชาชน
Datas.Photo.picture จะได้รูปภาพ
Datas.PhotoFileName     จะได้ตำแหน่งของไฟล์รูปภาพ

 (ถ้ากำหนดให้เซฟลงไฟล์)

วันพฤหัสบดีที่ 27 พฤศจิกายน พ.ศ. 2557

Unicode in RAD Studio

http://docwiki.embarcadero.com/RADStudio/XE7/en/Unicode_in_RAD_Studio

==================
Pchar-->PansiChar
String->AnsiString

======================

var
  AnsiStr: AnsiString;
  Str: string;
....
AnsiStr := Str;
AnsiStr := AnsiString(Str);




=====================



http://edn.embarcadero.com/article/38980

Delphi 7
function AnsiToDOS(S: String): String;
begin
  SetLength(Result, Length(S));
  if S <> '' then begin
     CharToOEM(PChar(S), PChar(Result));
  end;
end;
Delphi XE
function StringToOem(const S: String): AnsiString;
begin
  SetLength(Result, Length(S));
  if S <> '' then begin
    CharToOem(PChar(S), PAnsiChar(Result));
  end;
end;

function AnsiStringToOem(const S: AnsiString): AnsiString;
begin
  Result := S;
  UniqueString(Result);
  if S <> '' then begin
    CharToOemA(PAnsiChar(Result), PAnsiChar(Result));
  end;
end;

วันจันทร์ที่ 24 พฤศจิกายน พ.ศ. 2557