2020年10月29日 星期四
[c++]程式重啟
2020年10月13日 星期二
[git]stash指令
git stash 暫存指令
git stash list 可以看到目前的暫存清單
git stash drop 刪除最近一筆的暫存
git stash clear 刪除所有的暫存
git stash apply 恢復最近一筆
git stash 暫存目前的修正
使用方式:
git status (發現有修正)
git stash
git pull origin
git checkout develop
git status apply
-------
git操作及fatal: Authentication failed for錯誤解決
1、配置使用者資訊
git config –global user.name [username]
git config –global user.email
2、查詢使用者資訊
git config –list
3、如果push遇到在輸入密碼是熟錯後,就會報這個錯誤fatal: Authentication failed for
解決辦法:
git config –system –unset credential.helper
之後你在push就會提示輸入名稱和密碼
在使用此指令 允許權限使用(否則每次都會提示再輸入密碼)
git config --global credential.helper wincred
[GIT]修改commit 合併
情境::已經commit & push 要再次修改psh上的某一個commit要如何實現
STEP1: git status (確認目前要修改的內容狀態)
STEP2: git add -u (選擇要修改的全部檔案)
STEP3: git commit (因為會合併回上一個commit,在此命名為commit1,commit2)
STEP4: git rebase -i Head~2 (案I,將commit2開頭的pick刪除,改成s,並按下esc,:wq。按I,刪除commit log,再按esc,:wq。)
STEP5: git push origin Head -f
STEP6: 完成瞜! (commit2會合併回commit1)
2020年9月25日 星期五
[C#]建立文件,寫檔,刪除文件
protected void CreateFile()
{
String strTxt = ".\\" TEST.txt";
String strData = @"123456789";
// Delete a file by using File class static method...
if (System.IO.File.Exists(strTxt))
{
// Use a try block to catch IOExceptions, to
// handle the case of the file already being
// opened by another process.
try
{
System.IO.File.Delete(strTxt);
}
catch (System.IO.IOException e)
{
Console.WriteLine(e.Message);
return;
}
}
FileStream fileStream = new FileStream(strTxt, FileMode.Create);
fileStream.Close(); //切記開了要關,不然會被佔用而無法修改喔!!!
using (StreamWriter sw = new StreamWriter(strTxt,false))//覆寫檔案
{
// 欲寫入的文字資料 ~
sw.Write(strData );
//sw.WriteLine(DateTime.Now);
}
}
[c#]建創資料夾 取得目前檔案路徑資料夾
protected void CreateDataTemp()
{
string TempPath = System.Windows.Forms.Application.StartupPath + @"\要建立資料夾名稱\";
if (Directory.Exists(TempPath))
{
//資料夾存在
}
else
{
//新增資料夾
Directory.CreateDirectory(TempPath);
}
}
[C#]Tip提示文字
String strData= @"說明";
EditBoxInitTip(tb_TEST, strData);
protected void EditBoxInitTip(Control cTB, String strData)
{
//ToolTip:當游標停滯在某個控制項時,就會跳出一個小視窗
ToolTip toolTip1 = new ToolTip();
//SetToolTip:定義控制項會跳出提示的文字
toolTip1.SetToolTip(cTB, strData);
//以下為提示視窗的設定(通常會設定的部分)
//ToolTipIcon:設定顯示在提示視窗的圖示類型。
toolTip1.ToolTipIcon = ToolTipIcon.Info;
//ForeColor:顧名思義就是前景顏色,你懂的!!XD
toolTip1.ForeColor = Color.Blue;
//BackColor:顧名思義就是背景顏色,你也懂的!!XD
toolTip1.BackColor = Color.Gray;
//AutoPopDelay:當游標停滯在控制項,顯示提示視窗的時間。(以毫秒為單位)
toolTip1.AutoPopDelay = 1000;
//ToolTipTitle:設定提示視窗的標題。
toolTip1.ToolTipTitle = "提示訊息";
}
2020年6月18日 星期四
[BCB]messagebox
AnsiString str = BoolToStr( o_chkTXT->Checked );
Application->MessageBox(s.c_str(), "Test", 32+3);
char* c_str()
AnsiString str = "Hello World!";
MessageBox(NULL,str.c_str(),"",MB_OK); //顯示一個消息框
[SQL]顯示千分位與小數顯示
CONVERT ( data_type [ ( length ) ] , expression [ , style ] ) CONVERT style參數說明 1 (expression為 money 或 smallmoney型別): 0 : 預設,保留小數位後兩位,並四捨...
-
using System.IO; 取得程式當下檔案目錄資訊: string sPath = this .GetType().Assembly.Location; string filename = @"C:\Users\123.text...
-
兩個函式宣告,需要 using System.Diagnostics; ----------------------使用方式------------------------------------------- OpenPress( "AAA.exe...
-
常見CRC檢查碼 Common CRC codes 最常見的CRC檢查碼位元數目有8、16、32,一般表示都是CRC-8、CRC-16、CRC-32,CRC編碼越長偵測能力越強大,然而得更多時間傳送更長CRC檢查碼,CRC-16能偵測一個區塊內一或兩個位...