易截截图软件、单文件、免安装、纯绿色、仅160KB

C#取得域名以及目录地址的方法

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
namespace SinvanCMS.Common
{
    /// <summary>
    /// 全局类,当前域名,物理路径
    /// </summary>
    public class Application
    {
        /// <summary>
        /// 获得url路径, http://localhost/www_dalian/fangyuan.asp 的app部分如:http://localhost/www_dalian
        /// </summary>
        public static string AppUrl
        {
            get
            {
                return "http://" + System.Web.HttpContext.Current.Request.Url.Host.ToString() + AppSiteName;
            }
        }
        /// <summary>
        /// 获得 http://localhost/www_dalian/fangyuan.asp 的 部分如:www_dalian
        /// </summary>
        public static string AppSiteName
        {
            get
            {
                string SiteAddress = "";
                SiteAddress = System.Web.HttpContext.Current.Request.ApplicationPath.ToString();
        


相关文档:

C#里的treeview控件如何能绑定数据库里的数据

应用程序,窗体里拖放一个TreeView控件,想把数据库里的数据在这个控件里显示出来
  TREEVIEW控件是Winfrom窗体里的 不是ASP.NET里的TREEVIEW
代码如下:
CREATE TABLE CateTable (
      [ID] [int] IDENTITY (1, 1) NOT NULL ,
       [CateName] [nv ......

[摘自c#Bible]c#中namespace的使用(命名空间)

The C# classes that you design will be used by code that you write and possibly by code that
other people write. Your C# classes may be used by a VB.NET application or from within an
ASP.NET page. Moreover, your classes may very well be used alongside other classes
designed by other .NET develope ......

C#发送邮件代码 (B/S、C/S皆可用)

using System;
using System.Data;
using System.Configuration;
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;
using  ......

ASP.NET(C#)中string与stringBuilder的区别

 
在相同字符串的许多操作上,使用StringBuilder类会比使用String对象更有效率。
 
 
 当你对一个string对象赋值时,这时会生成一个这个对象的副本,如果你赋值多次的话在系统中就会保存多个这个对象的副本,会对系统资源造成很大的浪费,但是StringBuilder不会出先上述情况
String数据类型代表的 ......

asp.net(c#) static关键字用法小结[zz]

http://ayic1.blog.163.com/blog/static/27343030200965103528805/
静态变量
       当我们编写一个类时,其实就是在描述其对象的属性和行为,而并没有产生实质上的对象,只有通过new关键字才会产生出对象,这时系统才会分配内存空间给对象,其方法才可以供外部调用。
  & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号