易截截图软件、单文件、免安装、纯绿色、仅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#创建webservice及三种调用方式


微软.NET战略的一个比较重要的部分就是webservice,利用webservice我们可以创建真正有效的分布式应用程序。
下面,我们对webservice做一些说明。
假设A是客户端,B是webservice服务端,用户通过http协议向服务器发送soap请求,webservice返回客户端XML格式的数据。
现在我们看一看创建一个webservice的大致过程:
......

C# ASP.NET 获取脚本语句并用文本的方式显示出来

protected void Button6_Click(object sender, EventArgs e)
    {
        this.Label11.Text = HtmlEncode(this.TextBox3.Text);
 
       
    }
    protected static string HtmlEn ......

C#中的String.Format方法

一、定义
String.Format是将指定的 String类型的数据中的每个格式项替换为相应对象的值的文本等效项。
如:
(1)
string p1 = "Jackie";
string p2 = "Aillo";
Response.Write(String.Format("Hello {0}, I'm {1}", p1, p2));
(2)
Response.Write(String.Format("Hello {0}, I'm {1}", "Jackie", "Aillo"));
这 ......

C# params关键字

代码:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号