Chukeh.Current 小诸葛 - 当前 HTTP 请求扩展类说明
当前 HTTP 请求属性集合
Http
当前请求 HTTP 头
用法:Current.Http;
Domain
当前 HTTP 请求主机头
用法:Current.Domain;
Virtual
当前 WEB 应用的虚拟目录
用法:Current.Virtual;
Page
当前 HTTP 请求的页面 URL
用法:Current.Page;
Url
当前 HTTP 请求的完整 URL (包含参数信息)
用法:Current.Url;
UserAddress
当前 HTTP 请求的客户端 IP 地址
用法:Current.UserAddress;
PhysicalPath
当前 WEB 应用的实际路径
用法:Current.PhysicalPath;
Items
当前 HTTP 请求的变量集合
用法:Current.Items;
Querys
当前 HTTP 请求的参数集合
用法:Current.Querys;
当前 HTTP 请求扩展方法
AddItems
为当前 HTTP 请求添加变量集合
用法:Current.AddItems(object[]);
参数 1:自定义参数(例如:"Key1","Value1","Key2",3)
返回值:
Data.IHash
变量集合
VerityId
获取当前 HTTP 请求安全码
用法:Current.VerityId();
返回值:string 安全码
VerityId
判断当前 HTTP 请求安全码是否正确
用法:Current.VerityId(string, int);
参数 1:提交的安全码
参数 2:过期时间(单位分钟)
返回值:bool 是否安全请求
Put
将一个对象内容写入 HTTP 相应输出流
用法:Current.Put(object);
参数 1:对象内容
用法:Current.Put(string, object[]);
参数 1:格式化文本
参数 2:对象内容集合
PutItems
将当前 HTTP 请求中指定键名的变量写入 HTTP 相应输出流
用法:Current.PutItems(string);
参数 1:当前 HTTP 请求变量键名
用法:Current.PutItems(string, string[]);
参数 1:格式化文本
参数 2:当前 HTTP 请求变量键集合
PutQuerys
将当前 HTTP 请求中指定名称的参数写入 HTTP 相应输出流
用法:Current.PutQuerys(string);
参数 1:参数名称
用法:Current.PutQuerys(string, string[]);
参数 1:格式化文本
参数 2:参数名称集合
PutHash
将哈希表中指定键名的值写入 HTTP 相应输出流
用法:Current.PutHash(
Data.IHash
, string);
参数 1:哈希表
参数 2:键名
用法:Current.PutHash(string, string[]);
参数 1:哈希表
参数 2:格式化文本
参数 3:键名集合
IncludeFile
在当前 HTTP 请求包含指定文件
用法:Current.IncludeFile(string);
参数 1:文件相对路径
用法:Current.IncludeFile(string,
Data.IHash
);
参数 1:文件相对路径
参数 2:
Data.IHash
表
用法:Current.IncludeFile(string,
Data.ITable
);
参数 1:文件相对路径
参数 2:
Data.ITable
数据集
用法:Current.IncludeFile(string,
Data.ITable
, int, int, int);
参数 1:文件相对路径
参数 2:
Data.ITable
数据集
参数 3:int 当前选中记录索引
参数 4:int 当前编辑记录索引
参数 5:int 每行记录数
用法:Current.IncludeFile(string,
Data.ITable
,
Data.IHash
);
参数 1:文件相对路径
参数 2:
Data.ITable
数据集
参数 3:
Data.IHash
表
用法:Current.IncludeFile(string,
Data.ITable
,
Data.IHash
, int, int, int);
参数 1:文件相对路径
参数 2:
Data.ITable
数据集
参数 3:
Data.IHash
表
参数 4:int 当前选中记录索引
参数 5:int 当前编辑记录索引
参数 6:int 每行记录数
DownloadFile
将指定文件写入 HTTP 相应输出流
用法:Current.DownloadFile(string);
参数 1:文件绝对路径
SavePostedFile
保存提交的文件数据到指定位置
用法:Current.SavePostedFile(string, bool, string);
参数 1:文件绝对路径
参数 2:如果保存的目录不存在是否创建
参数 3:提交文件数据的参数名称
返回值:
Data.IResult
操作结果
SavePostedImage
保存提交的图片数据到指定位置
用法:Current.SavePostedImage(string, bool, double, string);
参数 1:图片绝对路径
参数 2:如果保存的目录不存在是否创建
参数 3:缩放比例,当小于 10 时为缩放比例,当大于 10 时为约束尺寸
参数 4:提交图片数据的参数名称
返回值:
Data.IResult
操作结果
当前 HTTP 请求 URL 地址操作方法
FilterUrl
过滤或修改当前请求 URL 地址中的指定参数
用法:Current.FilterUrl(string);
参数 1:要过滤得参数名称
返回值:string 过滤后的 URL 地址
用法:Current.FilterUrl(string[]);
参数 1:要过滤的参数名称集合
返回值:string 过滤后的 URL 地址
用法:Current.FilterUrl(string, string);
参数 1:要修改的参数名称
参数 2:要修改的参数值
返回值:string 过滤后的 URL 地址
用法:Current.FilterUrl(string[], string[]);
参数 1:要修改的参数名称集合
参数 2:要修改的参数值集合
返回值:string 过滤后的 URL 地址
当前 WEB 应用 Cache 操作方法
Cache
获取/设置指定名称的 Cache 内容
用法:Current.Cache(string);
参数 1:Cache 键名
返回值:object Cache 内容
用法:Current.Cache(string, object, DateTime);
参数 1:Cache 键名
参数 2:Cache 内容
参数 3:Cache 过期时间
当前 WEB 应用 Cookie 操作方法
Cookie
获取/设置指定键名的 Cookie 变量
用法:Current.Cookie(string);
参数 1:Cookie 键名
返回值:string Cookie 值
用法:Current.Cookie(string, string ,DateTime);
参数 1:Cookie 键名
参数 2:Cookie 值
参数 3:Cookie 过期时间
CookieContainsKey
查询键名的 Cookie 是否存在
用法:Current.CookieContainsKey(string);
参数 1:Cookie 键名
返回值:bool 存在 true,否则 false
当前 WEB 应用 Session 操作方法
Session
获取/设置指定键名的 Session 值
用法:Current.Session(string);
参数 1:Session 键名
返回值:object Session 值
用法:Current.Session(string, object);
参数 1:Session 键名
参数 2:Session 值
SessionContainsKey
查询指定键名的 Session 是否存在
用法:Current.SessionContainsKey(string);
参数 1:Session 键名
返回值:bool 存在 true,否则 false
SessionClear
清空当前 WEB 应用全部 Session
用法:Current.SessionClear();
当前 WEB 应用 Application 操作方法
Application
获取/设置指定键名的 Application 值
用法:Current.Application(string);
参数 1:Application 键名
返回值:object Application 值
用法:Current.Application(string, object);
参数 1:Application 键名
参数 2:Application 值
ApplicationContainsKey
查询指定键名的 Application 值是否存在
用法:Current.ApplicationContainsKey(string);
参数 1:Application 键名
返回值:bool 存在 true,否则 false
欢迎与我联系 Email:tianeyi(At)sina.com.cn QQ:21934667
Http://hi.baidu.com/tianeyi