new的用法
本帖最后由 seandro 于 2013-10-01 00:15:47 编辑 Driver的CS的代码
public class Driver
{
public int StrToInt32(string e)
{
if (!string.IsNullOrEmpty(e))
{
try
{
return Convert.ToInt32(e);
}
catch (Exception ex) { }
}
return 0;
}
public string GetUrlStr(string e)
{
if (!string.IsNullOrEmpty(Request.QueryString[e]))
return Request.QueryString[e];
return string.Empty;
}
}
public partial class index : System.Web.UI.Page
{
private Driver Driver = new Driver();
public string GetUrlStr(string e)
{
if (!string.IsNullOrEmpty(Request.QueryString[e]))
return Request.QueryString[e];
return string.Empty;
}
protected void Page_Load(object sender, EventArgs e)
{
userid= Driver.StrToInt32(GetUrlStr("userid"));
}
}
public partial class index : System.Web.UI.Page
{
private Driver Driver = new Driver();
public string GetUrlStr(string e)
{
if (!string.IsNullOrEmpty(Request.QueryString[e]))
return Request.QueryString[e];
return string.Empty;
}
protected void Page_Load(object sender, EventArgs e)
{
userid= Driver.StrToInt32(Driver.GetUrlStr("userid"));
}
}