Remote Desktop Connection Manager 管理遠端好幫手
2014年8月17日 星期日
常用Remote的人,常常會因為要記錄遠端資訊ip、帳號、密碼,用了這套可以幫你記錄所有的資訊進中管理,讓工作更有效率,而且現在是免費的
下載:
http://www.microsoft.com/en-us/download/details.aspx?id=21101
常用Remote的人,常常會因為要記錄遠端資訊ip、帳號、密碼,用了這套可以幫你記錄所有的資訊進中管理,讓工作更有效率,而且現在是免費的
下載:
http://www.microsoft.com/en-us/download/details.aspx?id=21101
情境:來源資料為txt檔,要利用這些資料做處理,例(select,update)
由於sql用 in有1000筆的限制,這時就可以用bulk insert 方法來處理。
取到之後就可以做應用啦。
請注意:檔案路徑是sql那台機器的路徑喔,檔案格式也一定要是Unicode,才不會出現亂碼喔。
create table #temp1
(col1 nvarchar(max))
bulk insert #temp1
from 'd:\temp\test.txt'
with (fieldterminator=',',rowterminator='\n')
go
select * from #temp1
drop table #temp1
MSDN:http://msdn.microsoft.com/zh-tw/library/ms175915.aspx
Read more...
注意事項:需要先下載WinMarge工具。
下載位址:http://winmerge.org/downloads/
修改TFS比對工具步驟如下:
Step1.
Step2.
Step3.
引數請輸入:/x /e /ub /wl /dl %6 /dr %7 %1 %2
就大工告成囉,之後用比較就會開始WinMarge工具來進行比對囉。
Read more...
取出圖片來源方式
string regular1 = "<img.+?src=[\"'](.+?)[\"'].*?>";
foreach (Match item in Regex.Matches(str, regular1))
{
string name = item.Groups[1].Value;
}
http://stackoverflow.com/questions/4257359/regular-expression-to-get-the-src-of-images-in-c-sharp
線上測試網站:
日期轉換成文字格式時,需注意事項:
參數大小寫解譯不同 MM=month, mm=Minutes, HH=24hours, hh=12hours
日期格式:2014-04-22 下午 04:00:00
DateTime d = DateTime.Now;
//hh:12小時制
string printDateTime = d.ToString("yyyy-MM-dd hh:mm:ss");
//輸出格式 2014-04-22 04:00:00
//HH:24小時制
string printDateTime1 = d.ToString("yyyy-MM-dd HH:mm:ss");
//輸出格式 2014-04-22 16:00:00
參考
http://msdn.microsoft.com/zh-tw/library/zdtaw1bw(v=vs.110).aspx
Read more...linq 裡也可以寫funciton來表示
原寫法,當資料有問題則直接出錯
List<Order> order = GetAllOrderList();
order = order.Where(o=>o.status.Equals(1) && o.paymentStatus.Equals(1));
如果要查哪筆資料出錯可以用以下寫法
List<Order> orderList = GetAllOrderList();
orderList = orderList.Where(o=>
{
var hasHit =false;
try
{
hasHit = o.status == "NCCC" && o.paymentStatus ==1;
}
catch(Exception ex)
{
var error = o.id;
var err = ex.Message;
}
}).ToList();
等於方式用”Equals”時要很小心,物件一定要有值才不會出錯
所以我改成用==方式來處理就沒這麼問題了
利用function寫法可以讓錯誤更容易偵錯喔。
Read more...在做圖片查詢時遇到存取被拒
語法如下:
string path="xxx"; //檔案路徑
using(FileStream fsm = new FileStream(path,FileMode.Open))
{
}
如果只要查詢建議將屬性設定要唯讀
string path="xxx"; //檔案路徑
using(FileStream fsm = new FileStream(path,FileMode.Open,FileAccess.Read))
{
}
參考來源:
http://msdn.microsoft.com/zh-tw/library/b6fz1x84(v=vs.110).aspx
Read more...