静态变量的名称,和方法的参数名称相同时
public class WebForm1 : System.Web.UI.Page
{
static string URL = "jeky.cn";
private void Page_Load(object sender, System.EventArgs e)
{
TTT("jeky");
}
void TTT(string URL)
{
// 显示参数值
HttpContext.Current.Response.Write ("<br />" + URL);
// 显示静态变量值
HttpContext.Current.Response.Write ("<br />" + WebForm1.URL);
}
}
{
static string URL = "jeky.cn";
private void Page_Load(object sender, System.EventArgs e)
{
TTT("jeky");
}
void TTT(string URL)
{
// 显示参数值
HttpContext.Current.Response.Write ("<br />" + URL);
// 显示静态变量值
HttpContext.Current.Response.Write ("<br />" + WebForm1.URL);
}
}