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();
相关文档:
后台代码:
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;
using System.Dat ......
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 ......
文 / 李博(光宇广贞)
方法多态与类型多态
了解 OOP 的同学对类型多态都很熟悉了。话说,类型多态之多态便体现在方法上,那方法多态又是嘛玩儿?类型多态之类型指的是对像的类型,其方法是受对像约束的。方法多态便是不受对像类型约束的多态。具体区别在:
方法多态无需继承 ......
http://ayic1.blog.163.com/blog/static/27343030200965103528805/
静态变量
当我们编写一个类时,其实就是在描述其对象的属性和行为,而并没有产生实质上的对象,只有通过new关键字才会产生出对象,这时系统才会分配内存空间给对象,其方法才可以供外部调用。
& ......
VB
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
MSComm1.CommPort = i1
MSComm1.PortOpen = True
MSComm1.InputMode = comInputModeBinary
MSComm1.InBufferCount = 0
& ......