智付寶
歐付寶
綠界
速買配
大型網站架構..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++;
}
早上看到一直使用的虛擬主機商遠振的新廣告,推出SSD硬碟的新主機。
強調
一直很喜歡它的主機服務。推給大家

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

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


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

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


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

7.最後選擇付款方式付款即完成
.htaccess是apache上的設定檔,一般都會開放讓使用者設定。.htaccess可以設定的很多,盜連、檔案列表、轉址….包羅萬象,不過今天只是要告訴大家修改上傳限制的方式而已,新增一個.htaccess的檔案,透過php_value可以修改php.ini的設定,例如我要把遠振虛擬主機上的某個網站設定上傳限制10M,我可以丟個.htaccess檔案,裡面放2行就可以了!但是其他網域就不變。
php_value upload_max_filesize 10M php_value post_max_size 10M
網站架設後,常常不知道針對搜尋引擎最佳化(SEO)是否做的好嗎?
介紹二個網站分析工具,可以針對訪客、內容、搜尋引擎最佳化(SEO)、網域名稱等來為網站評分,提供詳細的改善建議,幫網站站長們節省時間,改善後的網站能夠在搜尋引擎裡取得更好的搜尋排名,甚至是 PR 值。
1.SEOCert
http://www.seocert.net/
2.網站審評woorank
http://www.woorank.com/tw/
前阿里巴巴外籍員工porter,2年時間剪輯大作。獨家揭秘阿里巴巴早期的艱難生存經歷。馬雲的心路歷程,所有資料首次公映,一定要看!
閱讀全文〈【阿里紀錄片:揚子江大鱷】〉
這次雙十一出現看起來很像太空總署發射中心的阿里巴巴總部戰情室,其實只有五坪大小。但是卻是掌握所有淘寶、天貓、支付寶等網站加入會員、流量、成交金額等數據的戰情中心。
阿里集團下的天貓、淘寶在今天凌晨開始了一年一度的1111(雙11)購物狂歡節。
花了5小時49分成交額突破100億(第1分鐘破1億;6分7秒破10億;13分22秒破20億;20分51秒破30億….)
與去年的雙11相比,100億的速度提早了7小時就完成了,真是恐怖的數字。
不容忽略的行動商務的部份,也在4分10秒破了1億。


寫文章的同時,已經是121億了!
相關連結: