2011年12月8日 星期四

C# out 跟 ref 區別

out 在呼叫前不必先被指派。
ref 在呼叫前必需先被指派。

static void main()
{ int b;
test(out b);
Response.Write(b);

int c = 5;
test2(ref c);
Response.Write(c);
}
public void test2(ref int a)
{
//a = 10;

}
public void test(out int a ) {
a = 10;
}

2011年12月2日 星期五

Sniff Localhost

有時在本機開發些服務時,會想了解封裝內容有傳些什麼

可用Fiddler 去sniff 但他無法查localhost

轉個方式,把localhost 改machine name~固的!解!