当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > asp.net(c#)利用构造器链的代码

ASP.NET
深入理解__doPostBack 客户端调用服务端事件
asp.net(c#)利用构造器链的代码
asp.net Repeater绑定时使用函数
asp.net下linkbutton的前后台使用方法
ASP.NET编程中经常用到的27个函数集
asp.net高效替换大容量字符实现代码
asp.net(c#) ubb处理类
ASP.NET中的跳转 200, 301, 302转向实现代码
C#中的委托和事件学习(续)
asp.net网站安全从小做起与防范小结
asp.net 网页编码自动识别代码
asp.net HttpWebRequest自动识别网页编码
asp.net中调用winrar实现压缩解压缩的代码
dz asp.net论坛中函数--根据Url获得源文件内容
.NET 扩展实现代码
用Jquery访问WebService并返回Json的代码
asp.net(c#)判断远程图片是否存在
asp.net保存远程图片的代码
Asp.Net类库中发送电子邮件的代码
ASP.NET表单验证方法详解

ASP.NET 中的 asp.net(c#)利用构造器链的代码


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 56 ::
收藏到网摘: n/a

c#构造器链的实现代码,方便以后大家学习应用
复制代码 代码如下:

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;
}
}

}
}