复制代码 代码如下:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default4 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
WebInfo info = new WebInfo();
string infoOut = string.Format("站点:{0}<br>域名:{1}",info.WebName,info.WebUrl);
Response.Write(infoOut);
}
public class WebInfo
{
public WebInfo():this("搜索吧","http://www.sosuo8.com/")
{
}
public WebInfo(string webUrl):this("搜索吧",webUrl)
{
}
public WebInfo(string webName, string webUrl)
{
_webName = webName;
_webUrl = webUrl;
}
private string _webName;
private string _webUrl;
public string WebName
{
get
{
return _webName;
}
set
{
_webName = value;
}
}
public string WebUrl
{
get
{
return _webUrl;
}
set
{
_webUrl = value;
}
}
}
}
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default4 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
WebInfo info = new WebInfo();
string infoOut = string.Format("站点:{0}<br>域名:{1}",info.WebName,info.WebUrl);
Response.Write(infoOut);
}
public class WebInfo
{
public WebInfo():this("搜索吧","http://www.sosuo8.com/")
{
}
public WebInfo(string webUrl):this("搜索吧",webUrl)
{
}
public WebInfo(string webName, string webUrl)
{
_webName = webName;
_webUrl = webUrl;
}
private string _webName;
private string _webUrl;
public string WebName
{
get
{
return _webName;
}
set
{
_webName = value;
}
}
public string WebUrl
{
get
{
return _webUrl;
}
set
{
_webUrl = value;
}
}
}
}
标签:
asp.net,构造器链
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com
暂无“asp.net(c#)利用构造器链的代码”评论...