智付寶
歐付寶
綠界
速買配
大型網站架構..net 架構師.rabbitMQ.redis.行動開發.APP開發教學.PHP Laravel開發..net core C# 開發.架構師之路.Delphi開發.資料庫程式.進銷存.餐飲POS系統
Delphi或C#與信用卡連接的方式,有直接透過com port通訊或是透過呼叫exe的方式,利用in.txt、out.txt做溝通。然後回傳信用卡卡號/授權碼/刷卡金額等資訊。
示範一下Delphi與C#如何做信用卡線上刷卡。
Delphi
public
{ Public declarations }
ExecInfo : TShellExecuteInfo; // use shellapi
i:integer;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
s:String;
ts:TStringlist;
begin
ZeroMemory(@ExecInfo,SizeOf(ExecInfo));
with ExecInfo do begin
cbSize := SizeOf(ExecInfo);
fMask := SEE_MASK_NOCLOSEPROCESS;
lpVerb := 'open';
lpFile := 'ecr.exe';
Wnd := self.Handle;
nShow := SW_HIDE;
end;
s:='xxxxxxxxxxxxxxxxxxxx'; // 填上信用卡的溝通格式
ts := Tstringlist.Create;
ts.Clear;
ts.Add(s);
ts.SaveToFile('in.dat');
ts.Free;
ShellExecuteEx(@ExecInfo);
deletefile('out.dat');
caption := '刷卡中...';
timer1.Enabled := True;
i:=0;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var ts1:Tstringlist;
sstatus,smoney,scard,sappno:String;
begin
i:=i+1;
if fileexists('out.dat') then begin
Timer1.Enabled := false;
ts1 := Tstringlist.Create;
ts1.LoadFromFile('out.dat');
if ts1.Count >0 then begin
// 讀入檔案,解析格式
end;
ts1.Free;
end;
end;
string dir = System.Windows.Forms.Application.StartupPath;
[DllImport("user32.dll", EntryPoint = "FindWindow", CharSet = CharSet.Auto)]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
private void uForm1_Load(object sender, EventArgs e)
{
try
{
if (File.Exists(dir + "/out.txt")) //刪除out.txt
File.Delete(dir + "/out.txt");
string code = ""; // in.txt格式
using (StreamWriter sw = new StreamWriter(dir + "/in.txt")) //小寫TXT
sw.Write(code);
IntPtr PDC = FindWindow(null, "ecr"); //開啟PosDataCom
if (PDC == (IntPtr)0)
{
try
{
Process p = new Process();
p.StartInfo.FileName = dir + "/ecrnccc.exe";
p.StartInfo.WorkingDirectory = dir;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
}
catch (Exception exp)
{
return;
}
}
this.timer1.Enabled = true;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
private void timer1_Tick(object sender, EventArgs e)
{
if (times == 5)
{
times = 0;
i++;
if (i > 4)
{
i = 0;
try
{
if (File.Exists(dir + "/out.txt"))
{
using (StreamReader sr = new StreamReader(dir + "/out.txt")) //小寫TXT
{
String line;
if ((line = sr.ReadLine()) != null)
{
// 解析
}
else
return false;
return true;
}
}
return false;
}
catch
{
return false;
}
}
}
times++;
}

1. 進入PChome的買網址網站 http://myname.pchome.com.tw/

2. 在輸入你想購買的網址名稱輸入網址 ex: delphitaiwan 然後勾選要申請的域名後,按下購買


3. 因為有點選.net.tw跟.org.tw,所以會跳出需有電信執照、財團法人或非營利社團法人等資格才能申請。我們只要申請idv.tw的就將其他勾掉。金額就只剩400(你會發現不同域名有不同金額)~往下拉到下面按下一步

4. 接著會要求會員資料,沒有的話就申請一個


5. 接下來會請您輸入註冊網域的基本資料,如果有申請過可以點顯示最後一次註冊資料帶入最後一次資料。然後域名確定拼字無誤、 我已閱讀 PChome客戶個人資料蒐集應告知事項二個看完沒問題請打勾。

7.最後選擇付款方式付款即完成
2013年10月31日除了是萬聖節外,莫過於這個極可能顛覆電子商務市場的集團uitox(優達斯)上線的記者會。
去年9月,曾在2007年搞出PChome 24小時到貨服務的前 PChome 營運長謝振豊,寫下一段長達 3000 字的「離職創業感言」。隨即低調的開始建立uitox集團,打造他理想中的全球性電子商務平台。

在記者會仍舉辦的同時,uitox開站了。

新加坡 SOON
上 海 飛 牛
台 灣 ASAP




可以看得出服務都是以”效率”(Soon快速、飛牛也是快速、ASAP as soon as possible更是快速)。超期待uitox能帶領著台灣的電商走向全球。
uitox服務
uitox 104人力銀行職缺
延伸閱讀: