Masuit.Tools.Database Namespace

Masuit.Tools帮助文档
Masuit.Tools.Database Namespace

[Missing <summary> documentation for "N:Masuit.Tools.Database"]

Classes
 | Class | Description
Public class | DataExt | 日期操作扩展类
Public class | DataTableHelper | DataTable帮助类


DataExt Class

DataExt Class
日期操作扩展类
Inheritance Hierarchy
SystemObject
Masuit.Tools.DatabaseDataExt

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class DataExt
Methods
Name | Description
MapEntityT(DataRow) | 根据DataRow映射到实体模型
MapEntityT(IDataReader) | 根据DataReader映射到实体模型
MapEntityT(SqlDataReader) | 根据SqlDataReader映射到实体模型
Top
See Also

Reference

Masuit.Tools.Database Namespace


DataExt Methods

DataExt Methods
Methods
Name | Description
MapEntityT(DataRow) | 根据DataRow映射到实体模型
MapEntityT(IDataReader) | 根据DataReader映射到实体模型
MapEntityT(SqlDataReader) | 根据SqlDataReader映射到实体模型
Top
See Also

Reference

DataExt Class
Masuit.Tools.Database Namespace


DataExt.MapEntity Method

DataExtMapEntity Method
Overload List
Name | Description
MapEntityT(DataRow) | 根据DataRow映射到实体模型
MapEntityT(IDataReader) | 根据DataReader映射到实体模型
MapEntityT(SqlDataReader) | 根据SqlDataReader映射到实体模型
Top
See Also

Reference

DataExt Class
Masuit.Tools.Database Namespace


DataExt.MapEntity(T) Method (DataRow)

DataExtMapEntityT Method (DataRow)
根据DataRow映射到实体模型

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T MapEntity<T>(
    this DataRow row
)
where T : class

Parameters

row
Type: System.DataDataRow
数据行

Type Parameters

T
实体模型

Return Value

Type: T
映射后的实体模型

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DataRow. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataExt Class
MapEntity Overload
Masuit.Tools.Database Namespace


DataExt.MapEntity(T) Method (IDataReader)

DataExtMapEntityT Method (IDataReader)
根据DataReader映射到实体模型

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T MapEntity<T>(
    this IDataReader dr
)
where T : class

Parameters

dr
Type: System.DataIDataReader
IDataReader

Type Parameters

T
实体模型

Return Value

Type: T
映射后的实体模型

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IDataReader. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataExt Class
MapEntity Overload
Masuit.Tools.Database Namespace


DataExt.MapEntity(T) Method (SqlDataReader)

DataExtMapEntityT Method (SqlDataReader)
根据SqlDataReader映射到实体模型

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T MapEntity<T>(
    this SqlDataReader reader
)
where T : class

Parameters

reader
Type: System.Data.SqlClientSqlDataReader
SqlDataReader

Type Parameters

T
实体模型

Return Value

Type: T
映射后的实体模型

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type SqlDataReader. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataExt Class
MapEntity Overload
Masuit.Tools.Database Namespace


DataTableHelper Class

DataTableHelper Class
DataTable帮助类
Inheritance Hierarchy
SystemObject
Masuit.Tools.DatabaseDataTableHelper

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class DataTableHelper

The DataTableHelper type exposes the following members.

Methods
Name | Description
AddIdentityColumn | 给DataTable增加一个自增列 如果DataTable 存在 identityid 字段 则 直接返回DataTable 不做任何处理
CreateTable(ListString) | 根据nameList里面的字段创建一个表格,返回该表格的DataTable
CreateTable(String) | 通过字符列表创建表字段，字段格式可以是： 1) a,b,c,d,e 2) a|int,b|string,c|bool,d|decimal
DataTableToListT | DataTable转换成实体列表
FilterDataTable | 根据条件过滤表的内容
GetDataRowArray | 获得从DataRowCollection转换成的DataRow数组
GetTableFromRows | 将DataRow数组转换成DataTable，注意行数组的每个元素须具有相同的数据结构， 否则当有元素长度大于第一个元素时，抛出异常
IsHaveRows | 检查DataTable 是否有数据行
ListToDataTableT | 实体列表转换成DataTable
SortedTable | 排序表的视图
ToDataTableT(IListT) | 将泛型集合类转换成DataTable
ToDataTableT(IListT, String) | 将泛型集合类转换成DataTable
Top
See Also

Reference

Masuit.Tools.Database Namespace


DataTableHelper Methods

DataTableHelper Methods

The DataTableHelper type exposes the following members.

Methods
Name | Description
AddIdentityColumn | 给DataTable增加一个自增列 如果DataTable 存在 identityid 字段 则 直接返回DataTable 不做任何处理
CreateTable(ListString) | 根据nameList里面的字段创建一个表格,返回该表格的DataTable
CreateTable(String) | 通过字符列表创建表字段，字段格式可以是： 1) a,b,c,d,e 2) a|int,b|string,c|bool,d|decimal
DataTableToListT | DataTable转换成实体列表
FilterDataTable | 根据条件过滤表的内容
GetDataRowArray | 获得从DataRowCollection转换成的DataRow数组
GetTableFromRows | 将DataRow数组转换成DataTable，注意行数组的每个元素须具有相同的数据结构， 否则当有元素长度大于第一个元素时，抛出异常
IsHaveRows | 检查DataTable 是否有数据行
ListToDataTableT | 实体列表转换成DataTable
SortedTable | 排序表的视图
ToDataTableT(IListT) | 将泛型集合类转换成DataTable
ToDataTableT(IListT, String) | 将泛型集合类转换成DataTable
Top
See Also

Reference

DataTableHelper Class
Masuit.Tools.Database Namespace


DataTableHelper.AddIdentityColumn Method

DataTableHelperAddIdentityColumn Method
给DataTable增加一个自增列 如果DataTable 存在 identityid 字段 则 直接返回DataTable 不做任何处理

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DataTable AddIdentityColumn(
    this DataTable dt
)

Parameters

dt
Type: System.DataDataTable
DataTable

Return Value

Type: DataTable
返回Datatable 增加字段 identityid

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DataTable. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataTableHelper Class
Masuit.Tools.Database Namespace


DataTableHelper.CreateTable Method

DataTableHelperCreateTable Method
Overload List
Name | Description
CreateTable(ListString) | 根据nameList里面的字段创建一个表格,返回该表格的DataTable
CreateTable(String) | 通过字符列表创建表字段，字段格式可以是： 1) a,b,c,d,e 2) a|int,b|string,c|bool,d|decimal
Top
See Also

Reference

DataTableHelper Class
Masuit.Tools.Database Namespace


DataTableHelper.CreateTable Method (List(String))

DataTableHelperCreateTable Method (ListString)
根据nameList里面的字段创建一个表格,返回该表格的DataTable

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DataTable CreateTable(
    this List<string> nameList
)

Parameters

nameList
Type: System.Collections.GenericList String
包含字段信息的列表

Return Value

Type: DataTable
DataTable

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type List String . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataTableHelper Class
CreateTable Overload
Masuit.Tools.Database Namespace


DataTableHelper.CreateTable Method (String)

DataTableHelperCreateTable Method (String)
通过字符列表创建表字段，字段格式可以是：
1) a,b,c,d,e
2) a|int,b|string,c|bool,d|decimal

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DataTable CreateTable(
    string nameString
)

Parameters

nameString
Type: SystemString
字符列表

Return Value

Type: DataTable
内存表
See Also

Reference

DataTableHelper Class
CreateTable Overload
Masuit.Tools.Database Namespace


DataTableHelper.DataTableToList(T) Method

DataTableHelperDataTableToListT Method
DataTable转换成实体列表

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static IList<T> DataTableToList<T>(
    this DataTable table
)
where T : class

Parameters

table
Type: System.DataDataTable
datatable

Type Parameters

T
实体 T

Return Value

Type: IList T
强类型的数据集合

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DataTable. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataTableHelper Class
Masuit.Tools.Database Namespace


DataTableHelper.FilterDataTable Method

DataTableHelperFilterDataTable Method
根据条件过滤表的内容

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DataTable FilterDataTable(
    this DataTable dt,
    string condition
)

Parameters

dt
Type: System.DataDataTable
原内存表
condition
Type: SystemString
过滤条件

Return Value

Type: DataTable
过滤后的内存表

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DataTable. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataTableHelper Class
Masuit.Tools.Database Namespace


DataTableHelper.GetDataRowArray Method

DataTableHelperGetDataRowArray Method
获得从DataRowCollection转换成的DataRow数组

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DataRow[] GetDataRowArray(
    this DataRowCollection drc
)

Parameters

drc
Type: System.DataDataRowCollection
DataRowCollection

Return Value

Type: DataRow
DataRow数组

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DataRowCollection. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataTableHelper Class
Masuit.Tools.Database Namespace


DataTableHelper.GetTableFromRows Method

DataTableHelperGetTableFromRows Method
将DataRow数组转换成DataTable，注意行数组的每个元素须具有相同的数据结构， 否则当有元素长度大于第一个元素时，抛出异常

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DataTable GetTableFromRows(
    this DataRow[] rows
)

Parameters

rows
Type: System.DataDataRow
行数组

Return Value

Type: DataTable
将内存行组装成内存表

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataTableHelper Class
Masuit.Tools.Database Namespace


DataTableHelper.IsHaveRows Method

DataTableHelperIsHaveRows Method
检查DataTable 是否有数据行

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool IsHaveRows(
    this DataTable dt
)

Parameters

dt
Type: System.DataDataTable
DataTable

Return Value

Type: Boolean
是否有数据行

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DataTable. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataTableHelper Class
Masuit.Tools.Database Namespace


DataTableHelper.ListToDataTable(T) Method

DataTableHelperListToDataTableT Method
实体列表转换成DataTable

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DataTable ListToDataTable<T>(
    this IList<T> list
)
where T : class

Parameters

list
Type: System.Collections.GenericIList T
实体列表

Type Parameters

T
实体

Return Value

Type: DataTable
映射为数据表

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IList T. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataTableHelper Class
Masuit.Tools.Database Namespace


DataTableHelper.SortedTable Method

DataTableHelperSortedTable Method
排序表的视图

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DataTable SortedTable(
    this DataTable dt,
    params string[] sorts
)

Parameters

dt
Type: System.DataDataTable
原内存表
sorts
Type: SystemString
排序方式

Return Value

Type: DataTable
排序后的内存表

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DataTable. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataTableHelper Class
Masuit.Tools.Database Namespace


DataTableHelper.ToDataTable Method

DataTableHelperToDataTable Method
Overload List
Name | Description
ToDataTableT(IListT) | 将泛型集合类转换成DataTable
ToDataTableT(IListT, String) | 将泛型集合类转换成DataTable
Top
See Also

Reference

DataTableHelper Class
Masuit.Tools.Database Namespace


DataTableHelper.ToDataTable(T) Method (IList(T))

DataTableHelperToDataTableT Method (IListT)
将泛型集合类转换成DataTable

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DataTable ToDataTable<T>(
    this IList<T> list
)

Parameters

list
Type: System.Collections.GenericIList T
集合

Type Parameters

T
集合项类型

Return Value

Type: DataTable
数据集(表)

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IList T. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataTableHelper Class
ToDataTable Overload
Masuit.Tools.Database Namespace


DataTableHelper.ToDataTable(T) Method (IList(T), String[])

DataTableHelperToDataTableT Method (IListT, String)
将泛型集合类转换成DataTable

Namespace: Masuit.Tools.Database
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DataTable ToDataTable<T>(
    this IList<T> list,
    params string[] propertyName
)

Parameters

list
Type: System.Collections.GenericIList T
集合
propertyName
Type: SystemString
需要返回的列的列名

Type Parameters

T
集合项类型

Return Value

Type: DataTable
数据集(表)

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IList T. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DataTableHelper Class
ToDataTable Overload
Masuit.Tools.Database Namespace


Masuit.Tools.DateTimeExt Namespace

Masuit.Tools.DateTimeExt Namespace

[Missing <summary> documentation for "N:Masuit.Tools.DateTimeExt"]

Classes
 | Class | Description
Public class | ChineseCalendar | 中国农历年处理类用net自带类
Public class | CNCalendar | 日历操作
Public class | DateTimeHelper | 日期时间帮助类
Public class | DateUtil | 日期操作工具类
Public class | TimeHelper | 时间相关操作帮助类
Structures
 | Structure | Description
Public structure | CNCalendarStructDateFullInfo | 结构、完整的日期对象


ChineseCalendar Class

ChineseCalendar Class
中国农历年处理类用net自带类
Inheritance Hierarchy
SystemObject
Masuit.Tools.DateTimeExtChineseCalendar

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class ChineseCalendar

The ChineseCalendar type exposes the following members.

Methods
Name | Description
GetChineseDateTime | 根据公历获取农历日期
GetChineseDateTimeNow | 获取农历当前日期
GetLunisolarDay | 返回农历日
GetLunisolarMonth | 返回农历月
GetLunisolarYear | 返回农历天干地支年
GetShengXiao | 返回生肖
Top
Properties
Name | Description
MaxSupportedDateTime | 最大支持日期
MinSupportedDateTime | 最小支持日期
Now | 返回农历日期
Top
See Also

Reference

Masuit.Tools.DateTimeExt Namespace


ChineseCalendar Methods

ChineseCalendar Methods

The ChineseCalendar type exposes the following members.

Methods
Name | Description
GetChineseDateTime | 根据公历获取农历日期
GetChineseDateTimeNow | 获取农历当前日期
GetLunisolarDay | 返回农历日
GetLunisolarMonth | 返回农历月
GetLunisolarYear | 返回农历天干地支年
GetShengXiao | 返回生肖
Top
See Also

Reference

ChineseCalendar Class
Masuit.Tools.DateTimeExt Namespace


ChineseCalendar.GetChineseDateTime Method

ChineseCalendarGetChineseDateTime Method
根据公历获取农历日期

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetChineseDateTime(
    this DateTime datetime
)

Parameters

datetime
Type: SystemDateTime
公历日期

Return Value

Type: String
公历日期的字符串形式

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ChineseCalendar Class
Masuit.Tools.DateTimeExt Namespace


ChineseCalendar.GetChineseDateTimeNow Method

ChineseCalendarGetChineseDateTimeNow Method
获取农历当前日期

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetChineseDateTimeNow()

Return Value

Type: String
当前农历日期
See Also

Reference

ChineseCalendar Class
Masuit.Tools.DateTimeExt Namespace


ChineseCalendar.GetLunisolarDay Method

ChineseCalendarGetLunisolarDay Method
返回农历日

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetLunisolarDay(
    int day
)

Parameters

day
Type: SystemInt32
阳历日

Return Value

Type: String
农历日
Exceptions
Exception | Condition
ArgumentOutOfRangeException |
See Also

Reference

ChineseCalendar Class
Masuit.Tools.DateTimeExt Namespace


ChineseCalendar.GetLunisolarMonth Method

ChineseCalendarGetLunisolarMonth Method
返回农历月

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetLunisolarMonth(
    int month
)

Parameters

month
Type: SystemInt32
月份

Return Value

Type: String
农历月
Exceptions
Exception | Condition
ArgumentOutOfRangeException |
See Also

Reference

ChineseCalendar Class
Masuit.Tools.DateTimeExt Namespace


ChineseCalendar.GetLunisolarYear Method

ChineseCalendarGetLunisolarYear Method
返回农历天干地支年

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetLunisolarYear(
    int year
)

Parameters

year
Type: SystemInt32
农历年

Return Value

Type: String
天干地支年
Exceptions
Exception | Condition
ArgumentOutOfRangeException |
See Also

Reference

ChineseCalendar Class
Masuit.Tools.DateTimeExt Namespace


ChineseCalendar.GetShengXiao Method

ChineseCalendarGetShengXiao Method
返回生肖

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetShengXiao(
    this DateTime datetime
)

Parameters

datetime
Type: SystemDateTime
公历日期

Return Value

Type: String
生肖

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ChineseCalendar Class
Masuit.Tools.DateTimeExt Namespace


ChineseCalendar Properties

ChineseCalendar Properties

The ChineseCalendar type exposes the following members.

Properties
Name | Description
MaxSupportedDateTime | 最大支持日期
MinSupportedDateTime | 最小支持日期
Now | 返回农历日期
Top
See Also

Reference

ChineseCalendar Class
Masuit.Tools.DateTimeExt Namespace


ChineseCalendar.MaxSupportedDateTime Property

ChineseCalendarMaxSupportedDateTime Property
最大支持日期

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DateTime MaxSupportedDateTime { get; }

Property Value

Type: DateTime
See Also

Reference

ChineseCalendar Class
Masuit.Tools.DateTimeExt Namespace


ChineseCalendar.MinSupportedDateTime Property

ChineseCalendarMinSupportedDateTime Property
最小支持日期

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DateTime MinSupportedDateTime { get; }

Property Value

Type: DateTime
See Also

Reference

ChineseCalendar Class
Masuit.Tools.DateTimeExt Namespace


ChineseCalendar.Now Property

ChineseCalendarNow Property
返回农历日期

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Now { get; }

Property Value

Type: String
See Also

Reference

ChineseCalendar Class
Masuit.Tools.DateTimeExt Namespace


CNCalendar Class

CNCalendar Class
日历操作
Inheritance Hierarchy
SystemObject
Masuit.Tools.DateTimeExtCNCalendar

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class CNCalendar

The CNCalendar type exposes the following members.

Constructors
 | Name | Description
Public method | CNCalendar | Initializes a new instance of the CNCalendar class
Top
Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | getChinaDate | 获取农历
Public method | GetDateInfo | 得到日期信息
Public method | GetDateTidyInfo | 得到精简日期信息（不含节日）
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
 | ReadFileFromEmbedded | 从嵌入资源中读取文件内容(e.g: xml).
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

Masuit.Tools.DateTimeExt Namespace


CNCalendar Constructor

CNCalendar Constructor
Initializes a new instance of the CNCalendar class

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public CNCalendar()
See Also

Reference

CNCalendar Class
Masuit.Tools.DateTimeExt Namespace


CNCalendar Methods

CNCalendar Methods

The CNCalendar type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | getChinaDate | 获取农历
Public method | GetDateInfo | 得到日期信息
Public method | GetDateTidyInfo | 得到精简日期信息（不含节日）
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
 | ReadFileFromEmbedded | 从嵌入资源中读取文件内容(e.g: xml).
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

CNCalendar Class
Masuit.Tools.DateTimeExt Namespace


CNCalendar.getChinaDate Method

CNCalendargetChinaDate Method
获取农历

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public CNCalendarStructDateFullInfo getChinaDate(
    DateTime dt
)

Parameters

dt
Type: SystemDateTime
阳历日期

Return Value

Type: CNCalendarStructDateFullInfo

[Missing <returns> documentation for "M:Masuit.Tools.DateTimeExt.CNCalendar.getChinaDate(System.DateTime)"]

See Also

Reference

CNCalendar Class
Masuit.Tools.DateTimeExt Namespace


CNCalendar.GetDateInfo Method

CNCalendarGetDateInfo Method
得到日期信息

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public CNCalendarStructDateFullInfo GetDateInfo(
    DateTime d
)

Parameters

d
Type: SystemDateTime
待检查的日子

Return Value

Type: CNCalendarStructDateFullInfo
日期信息
See Also

Reference

CNCalendar Class
Masuit.Tools.DateTimeExt Namespace


CNCalendar.GetDateTidyInfo Method

CNCalendarGetDateTidyInfo Method
得到精简日期信息（不含节日）

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public CNCalendarStructDateFullInfo GetDateTidyInfo(
    DateTime d
)

Parameters

d
Type: SystemDateTime
待检查的日子

Return Value

Type: CNCalendarStructDateFullInfo
日期信息
See Also

Reference

CNCalendar Class
Masuit.Tools.DateTimeExt Namespace


CNCalendar.ReadFileFromEmbedded Method

CNCalendarReadFileFromEmbedded Method
从嵌入资源中读取文件内容(e.g: xml).

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ReadFileFromEmbedded(
    string fileWholeName
)

Parameters

fileWholeName
Type: SystemString
嵌入资源文件名，包括项目的命名空间.

Return Value

Type: String
资源中的文件内容.
See Also

Reference

CNCalendar Class
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo Structure

CNCalendarStructDateFullInfo Structure
结构、完整的日期对象

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public struct StructDateFullInfo

The CNCalendarStructDateFullInfo type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from ValueType.)
Public method | GetHashCode | (Inherited from ValueType.)
Public method | GetType | (Inherited from Object.)
Public method | ToString | (Inherited from ValueType.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Fields
 | Name | Description
Public field | Cday | 农历日
Public field | CdayCyl | 干支日
Public field | Cmonth | 农历月
Public field | CmonthCyl | 干支月
Public field | cnAnm | 农历属象
Public field | cnFtvl | 阴历节日
Public field | cnFtvs | 阳历节日
Public field | Cyear | 农历年
Public field | CyearCyl | 干支年
Public field | Day | 公历日
Public field | DayInWeek | 星期几
Public field | Feast | 节日
Public field | Fullinfo | 完整的日期信息
Public field | Image | 主题图片
Public field | Info | 系统问候语
Public field | IsLeap | 是否闰月
Public field | Month | 公历月
Public field | SayHello | 有特别的问候语吗
Public field | Scday | 农历日名称
Public field | Scmonth | 农历月名称
Public field | Scyear | 农历年名称
Public field | solarterm | 节气
Public field | Year | 公历年
Top
See Also

Reference

Masuit.Tools.DateTimeExt Namespace


StructDateFullInfo Fields

StructDateFullInfo Fields

The CNCalendarStructDateFullInfo type exposes the following members.

Fields
 | Name | Description
Public field | Cday | 农历日
Public field | CdayCyl | 干支日
Public field | Cmonth | 农历月
Public field | CmonthCyl | 干支月
Public field | cnAnm | 农历属象
Public field | cnFtvl | 阴历节日
Public field | cnFtvs | 阳历节日
Public field | Cyear | 农历年
Public field | CyearCyl | 干支年
Public field | Day | 公历日
Public field | DayInWeek | 星期几
Public field | Feast | 节日
Public field | Fullinfo | 完整的日期信息
Public field | Image | 主题图片
Public field | Info | 系统问候语
Public field | IsLeap | 是否闰月
Public field | Month | 公历月
Public field | SayHello | 有特别的问候语吗
Public field | Scday | 农历日名称
Public field | Scmonth | 农历月名称
Public field | Scyear | 农历年名称
Public field | solarterm | 节气
Public field | Year | 公历年
Top
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Cday Field

CNCalendarStructDateFullInfoCday Field
农历日

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public int Cday

Field Value

Type: Int32
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.CdayCyl Field

CNCalendarStructDateFullInfoCdayCyl Field
干支日

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string CdayCyl

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Cmonth Field

CNCalendarStructDateFullInfoCmonth Field
农历月

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public int Cmonth

Field Value

Type: Int32
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.CmonthCyl Field

CNCalendarStructDateFullInfoCmonthCyl Field
干支月

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string CmonthCyl

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.cnAnm Field

CNCalendarStructDateFullInfocnAnm Field
农历属象

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string cnAnm

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.cnFtvl Field

CNCalendarStructDateFullInfocnFtvl Field
阴历节日

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string cnFtvl

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.cnFtvs Field

CNCalendarStructDateFullInfocnFtvs Field
阳历节日

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string cnFtvs

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Cyear Field

CNCalendarStructDateFullInfoCyear Field
农历年

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public int Cyear

Field Value

Type: Int32
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.CyearCyl Field

CNCalendarStructDateFullInfoCyearCyl Field
干支年

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string CyearCyl

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Day Field

CNCalendarStructDateFullInfoDay Field
公历日

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public int Day

Field Value

Type: Int32
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.DayInWeek Field

CNCalendarStructDateFullInfoDayInWeek Field
星期几

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string DayInWeek

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Feast Field

CNCalendarStructDateFullInfoFeast Field
节日

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Feast

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Fullinfo Field

CNCalendarStructDateFullInfoFullinfo Field
完整的日期信息

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Fullinfo

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Image Field

CNCalendarStructDateFullInfoImage Field
主题图片

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Image

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Info Field

CNCalendarStructDateFullInfoInfo Field
系统问候语

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Info

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.IsLeap Field

CNCalendarStructDateFullInfoIsLeap Field
是否闰月

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool IsLeap

Field Value

Type: Boolean
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Month Field

CNCalendarStructDateFullInfoMonth Field
公历月

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public int Month

Field Value

Type: Int32
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.SayHello Field

CNCalendarStructDateFullInfoSayHello Field
有特别的问候语吗

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool SayHello

Field Value

Type: Boolean
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Scday Field

CNCalendarStructDateFullInfoScday Field
农历日名称

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Scday

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Scmonth Field

CNCalendarStructDateFullInfoScmonth Field
农历月名称

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Scmonth

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Scyear Field

CNCalendarStructDateFullInfoScyear Field
农历年名称

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Scyear

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.solarterm Field

CNCalendarStructDateFullInfosolarterm Field
节气

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string solarterm

Field Value

Type: String
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


CNCalendar.StructDateFullInfo.Year Field

CNCalendarStructDateFullInfoYear Field
公历年

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public int Year

Field Value

Type: Int32
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


StructDateFullInfo Methods

StructDateFullInfo Methods

The CNCalendarStructDateFullInfo type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from ValueType.)
Public method | GetHashCode | (Inherited from ValueType.)
Public method | GetType | (Inherited from Object.)
Public method | ToString | (Inherited from ValueType.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

CNCalendarStructDateFullInfo Structure
Masuit.Tools.DateTimeExt Namespace


DateTimeHelper Class

DateTimeHelper Class
日期时间帮助类
Inheritance Hierarchy
SystemObject
Masuit.Tools.DateTimeExtDateTimeHelper

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class DateTimeHelper

The DateTimeHelper type exposes the following members.

Methods
Name | Description
GetWeekAmount | 获取某一年有多少周
GetWeekTime | 得到一年中的某周的起始日和截止日 年 nYear 周数 nNumWeek 周始 out dtWeekStart 周终 out dtWeekeEnd
GetWeekWorkTime | 得到一年中的某周的起始日和截止日 周一到周五 工作日
SetLocalTime | 设置本地计算机时间
WeekOfYear(DateTime) | 返回年度第几个星期 默认星期日是第一天
WeekOfYear(DateTime, DayOfWeek) | 返回年度第几个星期
Top
See Also

Reference

Masuit.Tools.DateTimeExt Namespace


DateTimeHelper Methods

DateTimeHelper Methods

The DateTimeHelper type exposes the following members.

Methods
Name | Description
GetWeekAmount | 获取某一年有多少周
GetWeekTime | 得到一年中的某周的起始日和截止日 年 nYear 周数 nNumWeek 周始 out dtWeekStart 周终 out dtWeekeEnd
GetWeekWorkTime | 得到一年中的某周的起始日和截止日 周一到周五 工作日
SetLocalTime | 设置本地计算机时间
WeekOfYear(DateTime) | 返回年度第几个星期 默认星期日是第一天
WeekOfYear(DateTime, DayOfWeek) | 返回年度第几个星期
Top
See Also

Reference

DateTimeHelper Class
Masuit.Tools.DateTimeExt Namespace


DateTimeHelper.GetWeekAmount Method

DateTimeHelperGetWeekAmount Method
获取某一年有多少周

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int GetWeekAmount(
    int year
)

Parameters

year
Type: SystemInt32
年份

Return Value

Type: Int32
该年周数
See Also

Reference

DateTimeHelper Class
Masuit.Tools.DateTimeExt Namespace


DateTimeHelper.GetWeekTime Method

DateTimeHelperGetWeekTime Method
得到一年中的某周的起始日和截止日 年 nYear 周数 nNumWeek 周始 out dtWeekStart 周终 out dtWeekeEnd

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void GetWeekTime(
    int nYear,
    int nNumWeek,
    out DateTime dtWeekStart,
    out DateTime dtWeekeEnd
)

Parameters

nYear
Type: SystemInt32
年份
nNumWeek
Type: SystemInt32
第几周
dtWeekStart
Type: SystemDateTime
开始日期
dtWeekeEnd
Type: SystemDateTime
结束日期
See Also

Reference

DateTimeHelper Class
Masuit.Tools.DateTimeExt Namespace


DateTimeHelper.GetWeekWorkTime Method

DateTimeHelperGetWeekWorkTime Method
得到一年中的某周的起始日和截止日 周一到周五 工作日

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void GetWeekWorkTime(
    int nYear,
    int nNumWeek,
    out DateTime dtWeekStart,
    out DateTime dtWeekeEnd
)

Parameters

nYear
Type: SystemInt32
年份
nNumWeek
Type: SystemInt32
第几周
dtWeekStart
Type: SystemDateTime
开始日期
dtWeekeEnd
Type: SystemDateTime
结束日期
See Also

Reference

DateTimeHelper Class
Masuit.Tools.DateTimeExt Namespace


DateTimeHelper.SetLocalTime Method

DateTimeHelperSetLocalTime Method
设置本地计算机时间

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetLocalTime(
    this DateTime dt
)

Parameters

dt
Type: SystemDateTime
DateTime对象

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DateTimeHelper Class
Masuit.Tools.DateTimeExt Namespace


DateTimeHelper.WeekOfYear Method

DateTimeHelperWeekOfYear Method
Overload List
Name | Description
WeekOfYear(DateTime) | 返回年度第几个星期 默认星期日是第一天
WeekOfYear(DateTime, DayOfWeek) | 返回年度第几个星期
Top
See Also

Reference

DateTimeHelper Class
Masuit.Tools.DateTimeExt Namespace


DateTimeHelper.WeekOfYear Method (DateTime)

DateTimeHelperWeekOfYear Method (DateTime)
返回年度第几个星期 默认星期日是第一天

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int WeekOfYear(
    this DateTime date
)

Parameters

date
Type: SystemDateTime
时间

Return Value

Type: Int32
第几周

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DateTimeHelper Class
WeekOfYear Overload
Masuit.Tools.DateTimeExt Namespace


DateTimeHelper.WeekOfYear Method (DateTime, DayOfWeek)

DateTimeHelperWeekOfYear Method (DateTime, DayOfWeek)
返回年度第几个星期

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int WeekOfYear(
    this DateTime date,
    DayOfWeek week
)

Parameters

date
Type: SystemDateTime
时间
week
Type: SystemDayOfWeek
一周的开始日期

Return Value

Type: Int32
第几周

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DateTimeHelper Class
WeekOfYear Overload
Masuit.Tools.DateTimeExt Namespace


DateUtil Class

DateUtil Class
日期操作工具类
Inheritance Hierarchy
SystemObject
Masuit.Tools.DateTimeExtDateUtil

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class DateUtil

The DateUtil type exposes the following members.

Methods
Name | Description
ConvertDateToString | 将日期对象转化为格式字符串
ConvertStringToDate | 将输入的字符串转化为日期。如果字符串的格式非法，则返回当前日期。
GetDateTime | 返回相对于当前时间的相对天数
GetDateTimeF | 返回标准时间格式string
GetDaysOfMonth(DateTime) | 本月有多少天
GetDaysOfMonth(Int32, Int32) | 本月有多少天
GetDaysOfYear(DateTime) | 本年有多少天
GetDaysOfYear(Int32) | 返回本年有多少天
GetStandardDateTime(String) | 返回标准时间 yyyy-MM-dd HH:mm:ss
GetStandardDateTime(String, String) | 返回标准时间
GetWeekNameOfDay | 返回当前日期的星期名称
GetWeekNumberOfDay | 返回当前日期的星期编号
IsDateTime | 判断是否为合法日期，必须大于1800年1月1日
Top
See Also

Reference

Masuit.Tools.DateTimeExt Namespace


DateUtil Methods

DateUtil Methods

The DateUtil type exposes the following members.

Methods
Name | Description
ConvertDateToString | 将日期对象转化为格式字符串
ConvertStringToDate | 将输入的字符串转化为日期。如果字符串的格式非法，则返回当前日期。
GetDateTime | 返回相对于当前时间的相对天数
GetDateTimeF | 返回标准时间格式string
GetDaysOfMonth(DateTime) | 本月有多少天
GetDaysOfMonth(Int32, Int32) | 本月有多少天
GetDaysOfYear(DateTime) | 本年有多少天
GetDaysOfYear(Int32) | 返回本年有多少天
GetStandardDateTime(String) | 返回标准时间 yyyy-MM-dd HH:mm:ss
GetStandardDateTime(String, String) | 返回标准时间
GetWeekNameOfDay | 返回当前日期的星期名称
GetWeekNumberOfDay | 返回当前日期的星期编号
IsDateTime | 判断是否为合法日期，必须大于1800年1月1日
Top
See Also

Reference

DateUtil Class
Masuit.Tools.DateTimeExt Namespace


DateUtil.ConvertDateToString Method

DateUtilConvertDateToString Method
将日期对象转化为格式字符串

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ConvertDateToString(
    this DateTime oDateTime,
    string strFormat
)

Parameters

oDateTime
Type: SystemDateTime
日期对象
strFormat
Type: SystemString
格式： "SHORTDATE"===短日期 "LONGDATE"==长日期 其它====自定义格式

Return Value

Type: String
日期字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DateUtil Class
Masuit.Tools.DateTimeExt Namespace


DateUtil.ConvertStringToDate Method

DateUtilConvertStringToDate Method
将输入的字符串转化为日期。如果字符串的格式非法，则返回当前日期。

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DateTime ConvertStringToDate(
    string strInput
)

Parameters

strInput
Type: SystemString
输入字符串

Return Value

Type: DateTime
日期对象
See Also

Reference

DateUtil Class
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetDateTime Method

DateUtilGetDateTime Method
返回相对于当前时间的相对天数

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetDateTime(
    int relativeday
)

Parameters

relativeday
Type: SystemInt32
相对天数

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.DateTimeExt.DateUtil.GetDateTime(System.Int32)"]

See Also

Reference

DateUtil Class
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetDateTimeF Method

DateUtilGetDateTimeF Method
返回标准时间格式string

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetDateTimeF()

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.DateTimeExt.DateUtil.GetDateTimeF"]

See Also

Reference

DateUtil Class
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetDaysOfMonth Method

DateUtilGetDaysOfMonth Method
Overload List
Name | Description
GetDaysOfMonth(DateTime) | 本月有多少天
GetDaysOfMonth(Int32, Int32) | 本月有多少天
Top
See Also

Reference

DateUtil Class
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetDaysOfMonth Method (DateTime)

DateUtilGetDaysOfMonth Method (DateTime)
本月有多少天

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int GetDaysOfMonth(
    this DateTime dt
)

Parameters

dt
Type: SystemDateTime
日期

Return Value

Type: Int32
天数

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DateUtil Class
GetDaysOfMonth Overload
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetDaysOfMonth Method (Int32, Int32)

DateUtilGetDaysOfMonth Method (Int32, Int32)
本月有多少天

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int GetDaysOfMonth(
    int iYear,
    int month
)

Parameters

iYear
Type: SystemInt32
年
month
Type: SystemInt32
月

Return Value

Type: Int32
天数
See Also

Reference

DateUtil Class
GetDaysOfMonth Overload
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetDaysOfYear Method

DateUtilGetDaysOfYear Method
Overload List
Name | Description
GetDaysOfYear(DateTime) | 本年有多少天
GetDaysOfYear(Int32) | 返回本年有多少天
Top
See Also

Reference

DateUtil Class
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetDaysOfYear Method (DateTime)

DateUtilGetDaysOfYear Method (DateTime)
本年有多少天

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int GetDaysOfYear(
    this DateTime dt
)

Parameters

dt
Type: SystemDateTime
日期

Return Value

Type: Int32
本天在当年的天数

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DateUtil Class
GetDaysOfYear Overload
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetDaysOfYear Method (Int32)

DateUtilGetDaysOfYear Method (Int32)
返回本年有多少天

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int GetDaysOfYear(
    int iYear
)

Parameters

iYear
Type: SystemInt32
年份

Return Value

Type: Int32
本年的天数
See Also

Reference

DateUtil Class
GetDaysOfYear Overload
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetStandardDateTime Method

DateUtilGetStandardDateTime Method
Overload List
Name | Description
GetStandardDateTime(String) | 返回标准时间 yyyy-MM-dd HH:mm:ss
GetStandardDateTime(String, String) | 返回标准时间
Top
See Also

Reference

DateUtil Class
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetStandardDateTime Method (String)

DateUtilGetStandardDateTime Method (String)
返回标准时间 yyyy-MM-dd HH:mm:ss

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetStandardDateTime(
    string fDateTime
)

Parameters

fDateTime
Type: SystemString
日期时间字符串

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.DateTimeExt.DateUtil.GetStandardDateTime(System.String)"]

See Also

Reference

DateUtil Class
GetStandardDateTime Overload
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetStandardDateTime Method (String, String)

DateUtilGetStandardDateTime Method (String, String)
返回标准时间

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetStandardDateTime(
    string fDateTime,
    string formatStr
)

Parameters

fDateTime
Type: SystemString
日期时间字符串
formatStr
Type: SystemString
格式

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.DateTimeExt.DateUtil.GetStandardDateTime(System.String,System.String)"]

See Also

Reference

DateUtil Class
GetStandardDateTime Overload
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetWeekNameOfDay Method

DateUtilGetWeekNameOfDay Method
返回当前日期的星期名称

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetWeekNameOfDay(
    this DateTime idt
)

Parameters

idt
Type: SystemDateTime
日期

Return Value

Type: String
星期名称

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DateUtil Class
Masuit.Tools.DateTimeExt Namespace


DateUtil.GetWeekNumberOfDay Method

DateUtilGetWeekNumberOfDay Method
返回当前日期的星期编号

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetWeekNumberOfDay(
    this DateTime idt
)

Parameters

idt
Type: SystemDateTime
日期

Return Value

Type: String
星期数字编号

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

DateUtil Class
Masuit.Tools.DateTimeExt Namespace


DateUtil.IsDateTime Method

DateUtilIsDateTime Method
判断是否为合法日期，必须大于1800年1月1日

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool IsDateTime(
    string strDate
)

Parameters

strDate
Type: SystemString
输入日期字符串

Return Value

Type: Boolean
True/False
See Also

Reference

DateUtil Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper Class

TimeHelper Class
时间相关操作帮助类
Inheritance Hierarchy
SystemObject
Masuit.Tools.DateTimeExtTimeHelper

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class TimeHelper

The TimeHelper type exposes the following members.

Methods
Name | Description
CsharpTime2JavascriptTime | C#的时间到Javascript的时间的转换
CsharpTime2PhpTime | C#中的DateTime转换成PHP的时间
DateConvert | Rss日期时间转换，将时间全部转换为GMT时间
DateDiff | 返回时间差
DateDiff2 | 获得两个日期的间隔
FormatDate | 格式化日期时间
GetDateString | 获得8位时间整型数字
GetDiffTime(DateTime, DateTime) | 时间差
GetDiffTime(DateTime, DateTime, Int32) | 计算2个时间差
GetFormatDate | 将时间格式化成 年月日 的形式,如果时间为null，返回当前系统时间
GetFormatTime | 将时间格式化成 时分秒 的形式,如果时间为null，返回当前系统时间
GetMonthLastDate | 返回某年某月最后一天
GetRandomTime | 得到随机日期
GetTimeDelay | 获得一段时间内有多少小时
PhpTime2CsharpTime | PHP的时间转换成C#中的DateTime
ReturnDateFormat | 返回每月的第一天和最后一天
SecondToMinute | 把秒转换成分钟
Top
See Also

Reference

Masuit.Tools.DateTimeExt Namespace


TimeHelper Methods

TimeHelper Methods

The TimeHelper type exposes the following members.

Methods
Name | Description
CsharpTime2JavascriptTime | C#的时间到Javascript的时间的转换
CsharpTime2PhpTime | C#中的DateTime转换成PHP的时间
DateConvert | Rss日期时间转换，将时间全部转换为GMT时间
DateDiff | 返回时间差
DateDiff2 | 获得两个日期的间隔
FormatDate | 格式化日期时间
GetDateString | 获得8位时间整型数字
GetDiffTime(DateTime, DateTime) | 时间差
GetDiffTime(DateTime, DateTime, Int32) | 计算2个时间差
GetFormatDate | 将时间格式化成 年月日 的形式,如果时间为null，返回当前系统时间
GetFormatTime | 将时间格式化成 时分秒 的形式,如果时间为null，返回当前系统时间
GetMonthLastDate | 返回某年某月最后一天
GetRandomTime | 得到随机日期
GetTimeDelay | 获得一段时间内有多少小时
PhpTime2CsharpTime | PHP的时间转换成C#中的DateTime
ReturnDateFormat | 返回每月的第一天和最后一天
SecondToMinute | 把秒转换成分钟
Top
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.CsharpTime2JavascriptTime Method

TimeHelperCsharpTime2JavascriptTime Method
C#的时间到Javascript的时间的转换

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static long CsharpTime2JavascriptTime(
    this DateTime TheDate
)

Parameters

TheDate
Type: SystemDateTime
C#的时间

Return Value

Type: Int64
Javascript的时间

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.CsharpTime2PhpTime Method

TimeHelperCsharpTime2PhpTime Method
C#中的DateTime转换成PHP的时间

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static long CsharpTime2PhpTime(
    this DateTime time
)

Parameters

time
Type: SystemDateTime
C#时间

Return Value

Type: Int64
php时间

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.DateConvert Method

TimeHelperDateConvert Method
Rss日期时间转换，将时间全部转换为GMT时间

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DateConvert(
    string strDateTime
)

Parameters

strDateTime
Type: SystemString
Rss中读取的时间

Return Value

Type: String
处理后的标准时间格式
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.DateDiff Method

TimeHelperDateDiff Method
返回时间差

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DateDiff(
    this DateTime dateTime1,
    DateTime dateTime2
)

Parameters

dateTime1
Type: SystemDateTime
时间1
dateTime2
Type: SystemDateTime
时间2

Return Value

Type: String
时间差

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.DateDiff2 Method

TimeHelperDateDiff2 Method
获得两个日期的间隔

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static TimeSpan DateDiff2(
    this DateTime DateTime1,
    DateTime DateTime2
)

Parameters

DateTime1
Type: SystemDateTime
日期一。
DateTime2
Type: SystemDateTime
日期二。

Return Value

Type: TimeSpan
日期间隔TimeSpan。

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.FormatDate Method

TimeHelperFormatDate Method
格式化日期时间

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string FormatDate(
    this DateTime dateTime1,
    string dateMode
)

Parameters

dateTime1
Type: SystemDateTime
日期时间
dateMode
Type: SystemString
显示模式

Return Value

Type: String
0-9种模式的日期

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.GetDateString Method

TimeHelperGetDateString Method
获得8位时间整型数字

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetDateString(
    this DateTime dt
)

Parameters

dt
Type: SystemDateTime
当前的日期时间对象

Return Value

Type: String
8位时间整型数字

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.GetDiffTime Method

TimeHelperGetDiffTime Method
Overload List
Name | Description
GetDiffTime(DateTime, DateTime) | 时间差
GetDiffTime(DateTime, DateTime, Int32) | 计算2个时间差
Top
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.GetDiffTime Method (DateTime, DateTime)

TimeHelperGetDiffTime Method (DateTime, DateTime)
时间差

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetDiffTime(
    this DateTime beginTime,
    DateTime endTime
)

Parameters

beginTime
Type: SystemDateTime
开始时间
endTime
Type: SystemDateTime
结束时间

Return Value

Type: String
时间差

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

TimeHelper Class
GetDiffTime Overload
Masuit.Tools.DateTimeExt Namespace


TimeHelper.GetDiffTime Method (DateTime, DateTime, Int32)

TimeHelperGetDiffTime Method (DateTime, DateTime, Int32)
计算2个时间差

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetDiffTime(
    this DateTime beginTime,
    DateTime endTime,
    ref int mindTime
)

Parameters

beginTime
Type: SystemDateTime
开始时间
endTime
Type: SystemDateTime
结束时间
mindTime
Type: SystemInt32
中间的时间

Return Value

Type: String
时间差

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

TimeHelper Class
GetDiffTime Overload
Masuit.Tools.DateTimeExt Namespace


TimeHelper.GetFormatDate Method

TimeHelperGetFormatDate Method
将时间格式化成 年月日 的形式,如果时间为null，返回当前系统时间

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetFormatDate(
    this DateTime dt,
    char Separator
)

Parameters

dt
Type: SystemDateTime
年月日分隔符
Separator
Type: SystemChar
分隔符

Return Value

Type: String
xxxx年xx月xx日

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.GetFormatTime Method

TimeHelperGetFormatTime Method
将时间格式化成 时分秒 的形式,如果时间为null，返回当前系统时间

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetFormatTime(
    this DateTime dt,
    char Separator
)

Parameters

dt
Type: SystemDateTime
当前日期时间对象
Separator
Type: SystemChar
分隔符

Return Value

Type: String
xx时xx分xx秒

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.GetMonthLastDate Method

TimeHelperGetMonthLastDate Method
返回某年某月最后一天

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int GetMonthLastDate(
    int year,
    int month
)

Parameters

year
Type: SystemInt32
年份
month
Type: SystemInt32
月份

Return Value

Type: Int32
日
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.GetRandomTime Method

TimeHelperGetRandomTime Method
得到随机日期

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DateTime GetRandomTime(
    this DateTime time1,
    DateTime time2
)

Parameters

time1
Type: SystemDateTime
起始日期
time2
Type: SystemDateTime
结束日期

Return Value

Type: DateTime
间隔日期之间的 随机日期

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.GetTimeDelay Method

TimeHelperGetTimeDelay Method
获得一段时间内有多少小时

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetTimeDelay(
    this DateTime dtStar,
    DateTime dtEnd
)

Parameters

dtStar
Type: SystemDateTime
起始时间
dtEnd
Type: SystemDateTime
终止时间

Return Value

Type: String
小时差

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.PhpTime2CsharpTime Method

TimeHelperPhpTime2CsharpTime Method
PHP的时间转换成C#中的DateTime

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DateTime PhpTime2CsharpTime(
    long time
)

Parameters

time
Type: SystemInt64
php的时间

Return Value

Type: DateTime
C#的时间
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.ReturnDateFormat Method

TimeHelperReturnDateFormat Method
返回每月的第一天和最后一天

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void ReturnDateFormat(
    int month,
    out string firstDay,
    out string lastDay
)

Parameters

month
Type: SystemInt32
月份
firstDay
Type: SystemString
第一天
lastDay
Type: SystemString
最后一天
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


TimeHelper.SecondToMinute Method

TimeHelperSecondToMinute Method
把秒转换成分钟

Namespace: Masuit.Tools.DateTimeExt
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int SecondToMinute(
    int Second
)

Parameters

Second
Type: SystemInt32
秒数

Return Value

Type: Int32
分钟数
See Also

Reference

TimeHelper Class
Masuit.Tools.DateTimeExt Namespace


Masuit.Tools.Files Namespace

Masuit.Tools.Files Namespace

[Missing <summary> documentation for "N:Masuit.Tools.Files"]

Classes
 | Class | Description
Public class | ClassZip | ClassZip
Public class | ExtensionAttach | 文件关联
Public class | FileExt | 大文件操作扩展类
Public class | FileTree | 文件目录树操作
Public class | INIFile | INI文件操作辅助类
Public class | SharpZip | SharpZip
Public class | ZipHelper | WinRAR压缩操作


ClassZip Class

ClassZip Class
ClassZip
Inheritance Hierarchy
SystemObject
Masuit.Tools.FilesClassZip

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class ClassZip

The ClassZip type exposes the following members.

Methods
Name | Description
UnZip | 解压
Zip | 压缩
Top
See Also

Reference

Masuit.Tools.Files Namespace


ClassZip Methods

ClassZip Methods

The ClassZip type exposes the following members.

Methods
Name | Description
UnZip | 解压
Zip | 压缩
Top
See Also

Reference

ClassZip Class
Masuit.Tools.Files Namespace


ClassZip.UnZip Method

ClassZipUnZip Method
解压

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void UnZip(
    string FileToUpZip,
    string ZipedFolder
)

Parameters

FileToUpZip
Type: SystemString
待解压的文件
ZipedFolder
Type: SystemString
解压目标存放目录
See Also

Reference

ClassZip Class
Masuit.Tools.Files Namespace


ClassZip.Zip Method

ClassZipZip Method
压缩

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool Zip(
    string FileToZip,
    string ZipedFile,
    int level = 6
)

Parameters

FileToZip
Type: SystemString
待压缩的文件目录或文件
ZipedFile
Type: SystemString
生成的目标文件
level (Optional)
Type: SystemInt32
压缩级别，默认值6

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Masuit.Tools.Files.ClassZip.Zip(System.String,System.String,System.Int32)"]

See Also

Reference

ClassZip Class
Masuit.Tools.Files Namespace


ExtensionAttach Class

ExtensionAttach Class
文件关联
Inheritance Hierarchy
SystemObject
Masuit.Tools.FilesExtensionAttach

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class ExtensionAttach

The ExtensionAttach type exposes the following members.

Methods
Name | Description
DelReg | 取消文件关联
SaveReg | 关联文件
Top
See Also

Reference

Masuit.Tools.Files Namespace


ExtensionAttach Methods

ExtensionAttach Methods

The ExtensionAttach type exposes the following members.

Methods
Name | Description
DelReg | 取消文件关联
SaveReg | 关联文件
Top
See Also

Reference

ExtensionAttach Class
Masuit.Tools.Files Namespace


ExtensionAttach.DelReg Method

ExtensionAttachDelReg Method
取消文件关联

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void DelReg(
    string pFileTypeName
)

Parameters

pFileTypeName
Type: SystemString
文件类型
See Also

Reference

ExtensionAttach Class
Masuit.Tools.Files Namespace


ExtensionAttach.SaveReg Method

ExtensionAttachSaveReg Method
关联文件

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SaveReg(
    string filePathString,
    string pFileTypeName
)

Parameters

filePathString
Type: SystemString
应用程序路径
pFileTypeName
Type: SystemString
文件类型
See Also

Reference

ExtensionAttach Class
Masuit.Tools.Files Namespace


FileExt Class

FileExt Class
大文件操作扩展类
Inheritance Hierarchy
SystemObject
Masuit.Tools.FilesFileExt

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class FileExt

The FileExt type exposes the following members.

Methods
Name | Description
CopyToFile | 以文件流的形式复制大文件
CopyToFileAsync | 以文件流的形式复制大文件(异步方式)
GetFileMD5 | 计算文件的 MD5 值
GetFileMD5Async | 计算文件的 MD5 值
GetFileSha1 | 计算文件的 sha1 值
GetFileSha1Async | 计算文件的 sha1 值
Top
See Also

Reference

Masuit.Tools.Files Namespace


FileExt Methods

FileExt Methods

The FileExt type exposes the following members.

Methods
Name | Description
CopyToFile | 以文件流的形式复制大文件
CopyToFileAsync | 以文件流的形式复制大文件(异步方式)
GetFileMD5 | 计算文件的 MD5 值
GetFileMD5Async | 计算文件的 MD5 值
GetFileSha1 | 计算文件的 sha1 值
GetFileSha1Async | 计算文件的 sha1 值
Top
See Also

Reference

FileExt Class
Masuit.Tools.Files Namespace


FileExt.CopyToFile Method

FileExtCopyToFile Method
以文件流的形式复制大文件

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void CopyToFile(
    this Stream fs,
    string dest,
    int bufferSize = 8388608
)

Parameters

fs
Type: System.IOStream
源
dest
Type: SystemString
目标地址
bufferSize (Optional)
Type: SystemInt32
缓冲区大小，默认8MB

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Stream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

FileExt Class
Masuit.Tools.Files Namespace


FileExt.CopyToFileAsync Method

FileExtCopyToFileAsync Method
以文件流的形式复制大文件(异步方式)

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void CopyToFileAsync(
    this Stream fs,
    string dest,
    int bufferSize = 8388608
)

Parameters

fs
Type: System.IOStream
源
dest
Type: SystemString
目标地址
bufferSize (Optional)
Type: SystemInt32
缓冲区大小，默认8MB

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Stream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

FileExt Class
Masuit.Tools.Files Namespace


FileExt.GetFileMD5 Method

FileExtGetFileMD5 Method
计算文件的 MD5 值

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetFileMD5(
    this FileStream fs
)

Parameters

fs
Type: System.IOFileStream
源文件流

Return Value

Type: String
MD5 值16进制字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type FileStream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

FileExt Class
Masuit.Tools.Files Namespace


FileExt.GetFileMD5Async Method

FileExtGetFileMD5Async Method
计算文件的 MD5 值

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Task<string> GetFileMD5Async(
    this FileStream fs
)

Parameters

fs
Type: System.IOFileStream
源文件流

Return Value

Type: Task String
MD5 值16进制字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type FileStream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

FileExt Class
Masuit.Tools.Files Namespace


FileExt.GetFileSha1 Method

FileExtGetFileSha1 Method
计算文件的 sha1 值

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetFileSha1(
    this Stream fs
)

Parameters

fs
Type: System.IOStream
源文件流

Return Value

Type: String
sha1 值16进制字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Stream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

FileExt Class
Masuit.Tools.Files Namespace


FileExt.GetFileSha1Async Method

FileExtGetFileSha1Async Method
计算文件的 sha1 值

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Task<string> GetFileSha1Async(
    this FileStream fs
)

Parameters

fs
Type: System.IOFileStream
源文件流

Return Value

Type: Task String
sha1 值16进制字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type FileStream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

FileExt Class
Masuit.Tools.Files Namespace


FileTree Class

FileTree Class
文件目录树操作
Inheritance Hierarchy
SystemObject
Masuit.Tools.FilesFileTree

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class FileTree
Methods
Name | Description
GetFoldAll(String) | 获取指定文件夹下所有子目录及文件
GetFoldAll(String, String, String) | 获取指定文件夹下所有子目录及文件(下拉框形)
ListTreeShow(DirectoryInfo, Int32, String) | 获取指定文件夹下所有子目录及文件函数
ListTreeShow(DirectoryInfo, Int32, String, String) | 获取指定文件夹下所有子目录及文件函数
Top
See Also

Reference

Masuit.Tools.Files Namespace


FileTree Methods

FileTree Methods
Methods
Name | Description
GetFoldAll(String) | 获取指定文件夹下所有子目录及文件
GetFoldAll(String, String, String) | 获取指定文件夹下所有子目录及文件(下拉框形)
ListTreeShow(DirectoryInfo, Int32, String) | 获取指定文件夹下所有子目录及文件函数
ListTreeShow(DirectoryInfo, Int32, String, String) | 获取指定文件夹下所有子目录及文件函数
Top
See Also

Reference

FileTree Class
Masuit.Tools.Files Namespace


FileTree.GetFoldAll Method

FileTreeGetFoldAll Method
Overload List
Name | Description
GetFoldAll(String) | 获取指定文件夹下所有子目录及文件
GetFoldAll(String, String, String) | 获取指定文件夹下所有子目录及文件(下拉框形)
Top
See Also

Reference

FileTree Class
Masuit.Tools.Files Namespace


FileTree.GetFoldAll Method (String)

FileTreeGetFoldAll Method (String)
获取指定文件夹下所有子目录及文件

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetFoldAll(
    string Path
)

Parameters

Path
Type: SystemString
详细路径

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Files.FileTree.GetFoldAll(System.String)"]

See Also

Reference

FileTree Class
GetFoldAll Overload
Masuit.Tools.Files Namespace


FileTree.GetFoldAll Method (String, String, String)

FileTreeGetFoldAll Method (String, String, String)
获取指定文件夹下所有子目录及文件(下拉框形)

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetFoldAll(
    string Path,
    string DropName,
    string tplPath
)

Parameters

Path
Type: SystemString
详细路径
DropName
Type: SystemString
下拉列表名称
tplPath
Type: SystemString
默认选择模板名称

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Files.FileTree.GetFoldAll(System.String,System.String,System.String)"]

See Also

Reference

FileTree Class
GetFoldAll Overload
Masuit.Tools.Files Namespace


FileTree.ListTreeShow Method

FileTreeListTreeShow Method
Overload List
Name | Description
ListTreeShow(DirectoryInfo, Int32, String) | 获取指定文件夹下所有子目录及文件函数
ListTreeShow(DirectoryInfo, Int32, String, String) | 获取指定文件夹下所有子目录及文件函数
Top
See Also

Reference

FileTree Class
Masuit.Tools.Files Namespace


FileTree.ListTreeShow Method (DirectoryInfo, Int32, String)

FileTreeListTreeShow Method (DirectoryInfo, Int32, String)
获取指定文件夹下所有子目录及文件函数

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ListTreeShow(
    this DirectoryInfo theDir,
    int nLevel,
    string Rn
)

Parameters

theDir
Type: System.IODirectoryInfo
指定目录
nLevel
Type: SystemInt32
默认起始值,调用时,一般为0
Rn
Type: SystemString
用于迭加的传入值,一般为空

Return Value

Type: String
所有子目录及文件

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DirectoryInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

FileTree Class
ListTreeShow Overload
Masuit.Tools.Files Namespace


FileTree.ListTreeShow Method (DirectoryInfo, Int32, String, String)

FileTreeListTreeShow Method (DirectoryInfo, Int32, String, String)
获取指定文件夹下所有子目录及文件函数

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ListTreeShow(
    this DirectoryInfo theDir,
    int nLevel,
    string rn,
    string tplPath
)

Parameters

theDir
Type: System.IODirectoryInfo
指定目录
nLevel
Type: SystemInt32
默认起始值,调用时,一般为0
rn
Type: SystemString
用于迭加的传入值,一般为空
tplPath
Type: SystemString
默认选择模板名称

Return Value

Type: String
所有子目录及文件

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DirectoryInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

FileTree Class
ListTreeShow Overload
Masuit.Tools.Files Namespace


INIFile Class

INIFile Class
INI文件操作辅助类
Inheritance Hierarchy
SystemObject
Masuit.Tools.FilesINIFile

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class INIFile

The INIFile type exposes the following members.

Constructors
 | Name | Description
Public method | INIFile | 传入INI文件路径构造对象
Top
Methods
 | Name | Description
Public method | ClearAllSection | 删除ini文件下所有段落
Public method | ClearSection | 删除ini文件下指定段落下的所有键
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Public method | IniReadValue | 读取INI文件
Public method | IniReadValues | 读取INI文件
Public method | IniWriteValue | 写INI文件
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Fields
 | Name | Description
Public field | path | 文件路径
Top
See Also

Reference

Masuit.Tools.Files Namespace


INIFile Constructor

INIFile Constructor
传入INI文件路径构造对象

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public INIFile(
    string INIPath
)

Parameters

INIPath
Type: SystemString
INI文件路径
See Also

Reference

INIFile Class
Masuit.Tools.Files Namespace


INIFile Fields

INIFile Fields

The INIFile type exposes the following members.

Fields
 | Name | Description
Public field | path | 文件路径
Top
See Also

Reference

INIFile Class
Masuit.Tools.Files Namespace


INIFile.path Field

INIFilepath Field
文件路径

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public readonly string path

Field Value

Type: String
See Also

Reference

INIFile Class
Masuit.Tools.Files Namespace


INIFile Methods

INIFile Methods

The INIFile type exposes the following members.

Methods
 | Name | Description
Public method | ClearAllSection | 删除ini文件下所有段落
Public method | ClearSection | 删除ini文件下指定段落下的所有键
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Public method | IniReadValue | 读取INI文件
Public method | IniReadValues | 读取INI文件
Public method | IniWriteValue | 写INI文件
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

INIFile Class
Masuit.Tools.Files Namespace


INIFile.ClearAllSection Method

INIFileClearAllSection Method
删除ini文件下所有段落

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void ClearAllSection()
See Also

Reference

INIFile Class
Masuit.Tools.Files Namespace


INIFile.ClearSection Method

INIFileClearSection Method
删除ini文件下指定段落下的所有键

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void ClearSection(
    string Section
)

Parameters

Section
Type: SystemString
分组节点
See Also

Reference

INIFile Class
Masuit.Tools.Files Namespace


INIFile.IniReadValue Method

INIFileIniReadValue Method
读取INI文件

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string IniReadValue(
    string Section,
    string Key
)

Parameters

Section
Type: SystemString
分组节点
Key
Type: SystemString
关键字

Return Value

Type: String
值
See Also

Reference

INIFile Class
Masuit.Tools.Files Namespace


INIFile.IniReadValues Method

INIFileIniReadValues Method
读取INI文件

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public byte[] IniReadValues(
    string section,
    string key
)

Parameters

section
Type: SystemString
分组节点
key
Type: SystemString
关键字

Return Value

Type: Byte
值的字节表现形式
See Also

Reference

INIFile Class
Masuit.Tools.Files Namespace


INIFile.IniWriteValue Method

INIFileIniWriteValue Method
写INI文件

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void IniWriteValue(
    string Section,
    string Key,
    string Value
)

Parameters

Section
Type: SystemString
分组节点
Key
Type: SystemString
关键字
Value
Type: SystemString
值
See Also

Reference

INIFile Class
Masuit.Tools.Files Namespace


SharpZip Class

SharpZip Class
SharpZip
Inheritance Hierarchy
SystemObject
Masuit.Tools.FilesSharpZip

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class SharpZip

The SharpZip type exposes the following members.

Methods
Name | Description
PackFiles | 文件压缩
PackFilesAsync | 文件压缩
UnpackFiles | 文件解压缩
UnpackFilesAsync | 文件解压缩
Top
See Also

Reference

Masuit.Tools.Files Namespace


SharpZip Methods

SharpZip Methods

The SharpZip type exposes the following members.

Methods
Name | Description
PackFiles | 文件压缩
PackFilesAsync | 文件压缩
UnpackFiles | 文件解压缩
UnpackFilesAsync | 文件解压缩
Top
See Also

Reference

SharpZip Class
Masuit.Tools.Files Namespace


SharpZip.PackFiles Method

SharpZipPackFiles Method
文件压缩

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void PackFiles(
    string filename,
    string directory
)

Parameters

filename
Type: SystemString
压缩后的文件名(包含物理路径)
directory
Type: SystemString
待压缩的文件夹(包含物理路径)
See Also

Reference

SharpZip Class
Masuit.Tools.Files Namespace


SharpZip.PackFilesAsync Method

SharpZipPackFilesAsync Method
文件压缩

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void PackFilesAsync(
    string filename,
    string directory
)

Parameters

filename
Type: SystemString
压缩后的文件名(包含物理路径)
directory
Type: SystemString
待压缩的文件夹(包含物理路径)
See Also

Reference

SharpZip Class
Masuit.Tools.Files Namespace


SharpZip.UnpackFiles Method

SharpZipUnpackFiles Method
文件解压缩

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool UnpackFiles(
    string file,
    string dir
)

Parameters

file
Type: SystemString
待解压文件名(包含物理路径)
dir
Type: SystemString
解压到哪个目录中(包含物理路径)

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Masuit.Tools.Files.SharpZip.UnpackFiles(System.String,System.String)"]

See Also

Reference

SharpZip Class
Masuit.Tools.Files Namespace


SharpZip.UnpackFilesAsync Method

SharpZipUnpackFilesAsync Method
文件解压缩

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Task<bool> UnpackFilesAsync(
    string file,
    string dir
)

Parameters

file
Type: SystemString
待解压文件名(包含物理路径)
dir
Type: SystemString
解压到哪个目录中(包含物理路径)

Return Value

Type: Task Boolean

[Missing <returns> documentation for "M:Masuit.Tools.Files.SharpZip.UnpackFilesAsync(System.String,System.String)"]

See Also

Reference

SharpZip Class
Masuit.Tools.Files Namespace


ZipHelper Class

ZipHelper Class
WinRAR压缩操作
Inheritance Hierarchy
SystemObject
Masuit.Tools.FilesZipHelper

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class ZipHelper

The ZipHelper type exposes the following members.

Methods
Name | Description
DeZip | 解压缩
EnZip | 压缩
Top
See Also

Reference

Masuit.Tools.Files Namespace


ZipHelper Methods

ZipHelper Methods

The ZipHelper type exposes the following members.

Methods
Name | Description
DeZip | 解压缩
EnZip | 压缩
Top
See Also

Reference

ZipHelper Class
Masuit.Tools.Files Namespace


ZipHelper.DeZip Method

ZipHelperDeZip Method
解压缩

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void DeZip(
    string zipname,
    string zippath
)

Parameters

zipname
Type: SystemString
要解压的文件名
zippath
Type: SystemString
要解压的文件路径
See Also

Reference

ZipHelper Class
Masuit.Tools.Files Namespace


ZipHelper.EnZip Method

ZipHelperEnZip Method
压缩

Namespace: Masuit.Tools.Files
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void EnZip(
    string zipname,
    string zippath,
    string dirpath
)

Parameters

zipname
Type: SystemString
要解压的文件名
zippath
Type: SystemString
要压缩的文件目录
dirpath
Type: SystemString
初始目录
See Also

Reference

ZipHelper Class
Masuit.Tools.Files Namespace


Masuit.Tools.Hardware Namespace

Masuit.Tools.Hardware Namespace

[Missing <summary> documentation for "N:Masuit.Tools.Hardware"]

Classes
 | Class | Description
Public class | SystemInfo | 硬件信息
Public class | SystemInfoCpuInfo | CPU模型
Public class | SystemInfoRamInfo | 内存条模型
Structures
 | Structure | Description
Public structure | SystemInfoCPU_INFO | 定义CPU的信息结构
Public structure | SystemInfoMEMORY_INFO | 定义内存的信息结构
Public structure | SystemInfoSYSTEMTIME_INFO | 定义系统时间的信息结构


SystemInfo Class

SystemInfo Class
硬件信息
Inheritance Hierarchy
SystemObject
Masuit.Tools.HardwareSystemInfo

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class SystemInfo

The SystemInfo type exposes the following members.

Methods
Name | Description
FindAllApps | 查找所有应用程序标题
GetCpuCount | 获取CPU的数量
GetCpuInfo | 获取CPU信息
GetCPUTemperature | 获取CPU温度
GetIfTable |
GetRamInfo | 获取内存信息
GetSystemDirectory |
GetSystemInfo |
GetSystemTime |
GetWindow |
GetWindowLongA |
GetWindowsDirectory |
GetWindowText |
GetWindowTextLength |
GlobalMemoryStatus |
Top
Properties
Name | Description
CpuLoad | 获取CPU占用率 %
MemoryAvailable | 获取可用内存
PhysicalMemory | 获取物理内存
ProcessorCount | 获取CPU核心数
Top
See Also

Reference

Masuit.Tools.Hardware Namespace


SystemInfo Methods

SystemInfo Methods

The SystemInfo type exposes the following members.

Methods
Name | Description
FindAllApps | 查找所有应用程序标题
GetCpuCount | 获取CPU的数量
GetCpuInfo | 获取CPU信息
GetCPUTemperature | 获取CPU温度
GetIfTable |
GetRamInfo | 获取内存信息
GetSystemDirectory |
GetSystemInfo |
GetSystemTime |
GetWindow |
GetWindowLongA |
GetWindowsDirectory |
GetWindowText |
GetWindowTextLength |
GlobalMemoryStatus |
Top
See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.FindAllApps Method

SystemInfoFindAllApps Method
查找所有应用程序标题

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static ArrayList FindAllApps(
    int Handle
)

Parameters

Handle
Type: SystemInt32
应用程序标题范型

Return Value

Type: ArrayList
所有应用程序集合
See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetCpuCount Method

SystemInfoGetCpuCount Method
获取CPU的数量

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int GetCpuCount()

Return Value

Type: Int32
CPU的数量
See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetCpuInfo Method

SystemInfoGetCpuInfo Method
获取CPU信息

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static List<SystemInfoCpuInfo> GetCpuInfo()

Return Value

Type: List SystemInfoCpuInfo
CPU信息
See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetCPUTemperature Method

SystemInfoGetCPUTemperature Method
获取CPU温度

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static double GetCPUTemperature()

Return Value

Type: Double
CPU温度
See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetIfTable Method

SystemInfoGetIfTable Method

[Missing <summary> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetIfTable(System.Byte[],System.UInt32@,System.Boolean)"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static uint GetIfTable(
    byte[] pIfTable,
    ref uint pdwSize,
    bool bOrder
)

Parameters

pIfTable
Type: SystemByte

[Missing <param name="pIfTable"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetIfTable(System.Byte[],System.UInt32@,System.Boolean)"]

pdwSize
Type: SystemUInt32

[Missing <param name="pdwSize"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetIfTable(System.Byte[],System.UInt32@,System.Boolean)"]

bOrder
Type: SystemBoolean

[Missing <param name="bOrder"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetIfTable(System.Byte[],System.UInt32@,System.Boolean)"]

Return Value

Type: UInt32

[Missing <returns> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetIfTable(System.Byte[],System.UInt32@,System.Boolean)"]

See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetRamInfo Method

SystemInfoGetRamInfo Method
获取内存信息

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static SystemInfoRamInfo GetRamInfo()

Return Value

Type: SystemInfoRamInfo
内存信息
See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetSystemDirectory Method

SystemInfoGetSystemDirectory Method

[Missing <summary> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetSystemDirectory(System.Text.StringBuilder,System.Int32)"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void GetSystemDirectory(
    StringBuilder SysDir,
    int count
)

Parameters

SysDir
Type: System.TextStringBuilder

[Missing <param name="SysDir"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetSystemDirectory(System.Text.StringBuilder,System.Int32)"]

count
Type: SystemInt32

[Missing <param name="count"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetSystemDirectory(System.Text.StringBuilder,System.Int32)"]

See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetSystemInfo Method

SystemInfoGetSystemInfo Method

[Missing <summary> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetSystemInfo(Masuit.Tools.Hardware.SystemInfo.CPU_INFO@)"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void GetSystemInfo(
    ref SystemInfoCPU_INFO cpuinfo
)

Parameters

cpuinfo
Type: Masuit.Tools.HardwareSystemInfoCPU_INFO

[Missing <param name="cpuinfo"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetSystemInfo(Masuit.Tools.Hardware.SystemInfo.CPU_INFO@)"]

See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetSystemTime Method

SystemInfoGetSystemTime Method

[Missing <summary> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetSystemTime(Masuit.Tools.Hardware.SystemInfo.SYSTEMTIME_INFO@)"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void GetSystemTime(
    ref SystemInfoSYSTEMTIME_INFO stinfo
)

Parameters

stinfo
Type: Masuit.Tools.HardwareSystemInfoSYSTEMTIME_INFO

[Missing <param name="stinfo"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetSystemTime(Masuit.Tools.Hardware.SystemInfo.SYSTEMTIME_INFO@)"]

See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetWindow Method

SystemInfoGetWindow Method

[Missing <summary> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindow(System.Int32,System.Int32)"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int GetWindow(
    int hWnd,
    int wCmd
)

Parameters

hWnd
Type: SystemInt32

[Missing <param name="hWnd"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindow(System.Int32,System.Int32)"]

wCmd
Type: SystemInt32

[Missing <param name="wCmd"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindow(System.Int32,System.Int32)"]

Return Value

Type: Int32

[Missing <returns> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindow(System.Int32,System.Int32)"]

See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetWindowLongA Method

SystemInfoGetWindowLongA Method

[Missing <summary> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowLongA(System.Int32,System.Int32)"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int GetWindowLongA(
    int hWnd,
    int wIndx
)

Parameters

hWnd
Type: SystemInt32

[Missing <param name="hWnd"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowLongA(System.Int32,System.Int32)"]

wIndx
Type: SystemInt32

[Missing <param name="wIndx"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowLongA(System.Int32,System.Int32)"]

Return Value

Type: Int32

[Missing <returns> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowLongA(System.Int32,System.Int32)"]

See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetWindowsDirectory Method

SystemInfoGetWindowsDirectory Method

[Missing <summary> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowsDirectory(System.Text.StringBuilder,System.Int32)"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void GetWindowsDirectory(
    StringBuilder WinDir,
    int count
)

Parameters

WinDir
Type: System.TextStringBuilder

[Missing <param name="WinDir"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowsDirectory(System.Text.StringBuilder,System.Int32)"]

count
Type: SystemInt32

[Missing <param name="count"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowsDirectory(System.Text.StringBuilder,System.Int32)"]

See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetWindowText Method

SystemInfoGetWindowText Method

[Missing <summary> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowText(System.Int32,System.Text.StringBuilder,System.Int32)"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool GetWindowText(
    int hWnd,
    StringBuilder title,
    int maxBufSize
)

Parameters

hWnd
Type: SystemInt32

[Missing <param name="hWnd"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowText(System.Int32,System.Text.StringBuilder,System.Int32)"]

title
Type: System.TextStringBuilder

[Missing <param name="title"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowText(System.Int32,System.Text.StringBuilder,System.Int32)"]

maxBufSize
Type: SystemInt32

[Missing <param name="maxBufSize"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowText(System.Int32,System.Text.StringBuilder,System.Int32)"]

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowText(System.Int32,System.Text.StringBuilder,System.Int32)"]

See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GetWindowTextLength Method

SystemInfoGetWindowTextLength Method

[Missing <summary> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowTextLength(System.IntPtr)"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int GetWindowTextLength(
    IntPtr hWnd
)

Parameters

hWnd
Type: SystemIntPtr

[Missing <param name="hWnd"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowTextLength(System.IntPtr)"]

Return Value

Type: Int32

[Missing <returns> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GetWindowTextLength(System.IntPtr)"]

See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.GlobalMemoryStatus Method

SystemInfoGlobalMemoryStatus Method

[Missing <summary> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GlobalMemoryStatus(Masuit.Tools.Hardware.SystemInfo.MEMORY_INFO@)"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void GlobalMemoryStatus(
    ref SystemInfoMEMORY_INFO meminfo
)

Parameters

meminfo
Type: Masuit.Tools.HardwareSystemInfoMEMORY_INFO

[Missing <param name="meminfo"/> documentation for "M:Masuit.Tools.Hardware.SystemInfo.GlobalMemoryStatus(Masuit.Tools.Hardware.SystemInfo.MEMORY_INFO@)"]

See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo Properties

SystemInfo Properties

The SystemInfo type exposes the following members.

Properties
Name | Description
CpuLoad | 获取CPU占用率 %
MemoryAvailable | 获取可用内存
PhysicalMemory | 获取物理内存
ProcessorCount | 获取CPU核心数
Top
See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.CpuLoad Property

SystemInfoCpuLoad Property
获取CPU占用率 %

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static float CpuLoad { get; }

Property Value

Type: Single
See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.MemoryAvailable Property

SystemInfoMemoryAvailable Property
获取可用内存

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static long MemoryAvailable { get; }

Property Value

Type: Int64
See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.PhysicalMemory Property

SystemInfoPhysicalMemory Property
获取物理内存

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static long PhysicalMemory { get; }

Property Value

Type: Int64
See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.ProcessorCount Property

SystemInfoProcessorCount Property
获取CPU核心数

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int ProcessorCount { get; }

Property Value

Type: Int32
See Also

Reference

SystemInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.CPU_INFO Structure

SystemInfoCPU_INFO Structure
定义CPU的信息结构

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public struct CPU_INFO

The SystemInfoCPU_INFO type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from ValueType.)
Public method | GetHashCode | (Inherited from ValueType.)
Public method | GetType | (Inherited from Object.)
Public method | ToString | (Inherited from ValueType.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Fields
 | Name | Description
Public field | dwActiveProcessorMask |
Public field | dwAllocationGranularity |
Public field | dwNumberOfProcessors |
Public field | dwOemId |
Public field | dwPageSize |
Public field | dwProcessorLevel |
Public field | dwProcessorRevision |
Public field | dwProcessorType |
Public field | lpMaximumApplicationAddress |
Public field | lpMinimumApplicationAddress |
Top
See Also

Reference

Masuit.Tools.Hardware Namespace


CPU_INFO Fields

CPU_INFO Fields

The SystemInfoCPU_INFO type exposes the following members.

Fields
 | Name | Description
Public field | dwActiveProcessorMask |
Public field | dwAllocationGranularity |
Public field | dwNumberOfProcessors |
Public field | dwOemId |
Public field | dwPageSize |
Public field | dwProcessorLevel |
Public field | dwProcessorRevision |
Public field | dwProcessorType |
Public field | lpMaximumApplicationAddress |
Public field | lpMinimumApplicationAddress |
Top
See Also

Reference

SystemInfoCPU_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.CPU_INFO.dwActiveProcessorMask Field

SystemInfoCPU_INFOdwActiveProcessorMask Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.CPU_INFO.dwActiveProcessorMask"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwActiveProcessorMask

Field Value

Type: UInt32
See Also

Reference

SystemInfoCPU_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.CPU_INFO.dwAllocationGranularity Field

SystemInfoCPU_INFOdwAllocationGranularity Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.CPU_INFO.dwAllocationGranularity"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwAllocationGranularity

Field Value

Type: UInt32
See Also

Reference

SystemInfoCPU_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.CPU_INFO.dwNumberOfProcessors Field

SystemInfoCPU_INFOdwNumberOfProcessors Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.CPU_INFO.dwNumberOfProcessors"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwNumberOfProcessors

Field Value

Type: UInt32
See Also

Reference

SystemInfoCPU_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.CPU_INFO.dwOemId Field

SystemInfoCPU_INFOdwOemId Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.CPU_INFO.dwOemId"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwOemId

Field Value

Type: UInt32
See Also

Reference

SystemInfoCPU_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.CPU_INFO.dwPageSize Field

SystemInfoCPU_INFOdwPageSize Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.CPU_INFO.dwPageSize"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwPageSize

Field Value

Type: UInt32
See Also

Reference

SystemInfoCPU_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.CPU_INFO.dwProcessorLevel Field

SystemInfoCPU_INFOdwProcessorLevel Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.CPU_INFO.dwProcessorLevel"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwProcessorLevel

Field Value

Type: UInt32
See Also

Reference

SystemInfoCPU_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.CPU_INFO.dwProcessorRevision Field

SystemInfoCPU_INFOdwProcessorRevision Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.CPU_INFO.dwProcessorRevision"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwProcessorRevision

Field Value

Type: UInt32
See Also

Reference

SystemInfoCPU_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.CPU_INFO.dwProcessorType Field

SystemInfoCPU_INFOdwProcessorType Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.CPU_INFO.dwProcessorType"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwProcessorType

Field Value

Type: UInt32
See Also

Reference

SystemInfoCPU_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.CPU_INFO.lpMaximumApplicationAddress Field

SystemInfoCPU_INFOlpMaximumApplicationAddress Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.CPU_INFO.lpMaximumApplicationAddress"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint lpMaximumApplicationAddress

Field Value

Type: UInt32
See Also

Reference

SystemInfoCPU_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.CPU_INFO.lpMinimumApplicationAddress Field

SystemInfoCPU_INFOlpMinimumApplicationAddress Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.CPU_INFO.lpMinimumApplicationAddress"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint lpMinimumApplicationAddress

Field Value

Type: UInt32
See Also

Reference

SystemInfoCPU_INFO Structure
Masuit.Tools.Hardware Namespace


CPU_INFO Methods

CPU_INFO Methods

The SystemInfoCPU_INFO type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from ValueType.)
Public method | GetHashCode | (Inherited from ValueType.)
Public method | GetType | (Inherited from Object.)
Public method | ToString | (Inherited from ValueType.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

SystemInfoCPU_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.CpuInfo Class

SystemInfoCpuInfo Class
CPU模型
Inheritance Hierarchy
SystemObject
Masuit.Tools.HardwareSystemInfoCpuInfo

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class CpuInfo

The SystemInfoCpuInfo type exposes the following members.

Constructors
 | Name | Description
Public method | SystemInfoCpuInfo | Initializes a new instance of the SystemInfoCpuInfo class
Top
Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Properties
 | Name | Description
Public property | CpuLoad | CPU使用率
Public property | CurrentClockSpeed | CPU的时钟频率
Public property | DataWidth | CPU位宽
Public property | DeviceID | 设备ID端口
Public property | Manufacturer | CPU厂商
Public property | MaxClockSpeed | CPU最大睿频
Public property | NumberOfCores | CPU核心数
Public property | NumberOfLogicalProcessors | 逻辑处理器核心数
Public property | Temperature | 核心温度
Public property | Type | CPU型号
Top
See Also

Reference

Masuit.Tools.Hardware Namespace


SystemInfo.CpuInfo Constructor

SystemInfoCpuInfo Constructor
Initializes a new instance of the SystemInfoCpuInfo class

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public CpuInfo()
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


CpuInfo Methods

CpuInfo Methods

The SystemInfoCpuInfo type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


CpuInfo Properties

CpuInfo Properties

The SystemInfoCpuInfo type exposes the following members.

Properties
 | Name | Description
Public property | CpuLoad | CPU使用率
Public property | CurrentClockSpeed | CPU的时钟频率
Public property | DataWidth | CPU位宽
Public property | DeviceID | 设备ID端口
Public property | Manufacturer | CPU厂商
Public property | MaxClockSpeed | CPU最大睿频
Public property | NumberOfCores | CPU核心数
Public property | NumberOfLogicalProcessors | 逻辑处理器核心数
Public property | Temperature | 核心温度
Public property | Type | CPU型号
Top
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.CpuInfo.CpuLoad Property

SystemInfoCpuInfoCpuLoad Property
CPU使用率

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double CpuLoad { get; set; }

Property Value

Type: Double
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.CpuInfo.CurrentClockSpeed Property

SystemInfoCpuInfoCurrentClockSpeed Property
CPU的时钟频率

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string CurrentClockSpeed { get; set; }

Property Value

Type: String
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.CpuInfo.DataWidth Property

SystemInfoCpuInfoDataWidth Property
CPU位宽

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string DataWidth { get; set; }

Property Value

Type: String
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.CpuInfo.DeviceID Property

SystemInfoCpuInfoDeviceID Property
设备ID端口

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string DeviceID { get; set; }

Property Value

Type: String
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.CpuInfo.Manufacturer Property

SystemInfoCpuInfoManufacturer Property
CPU厂商

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Manufacturer { get; set; }

Property Value

Type: String
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.CpuInfo.MaxClockSpeed Property

SystemInfoCpuInfoMaxClockSpeed Property
CPU最大睿频

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string MaxClockSpeed { get; set; }

Property Value

Type: String
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.CpuInfo.NumberOfCores Property

SystemInfoCpuInfoNumberOfCores Property
CPU核心数

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public int NumberOfCores { get; set; }

Property Value

Type: Int32
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.CpuInfo.NumberOfLogicalProcessors Property

SystemInfoCpuInfoNumberOfLogicalProcessors Property
逻辑处理器核心数

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public int NumberOfLogicalProcessors { get; set; }

Property Value

Type: Int32
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.CpuInfo.Temperature Property

SystemInfoCpuInfoTemperature Property
核心温度

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double Temperature { get; set; }

Property Value

Type: Double
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.CpuInfo.Type Property

SystemInfoCpuInfoType Property
CPU型号

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Type { get; set; }

Property Value

Type: String
See Also

Reference

SystemInfoCpuInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.MEMORY_INFO Structure

SystemInfoMEMORY_INFO Structure
定义内存的信息结构

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public struct MEMORY_INFO

The SystemInfoMEMORY_INFO type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from ValueType.)
Public method | GetHashCode | (Inherited from ValueType.)
Public method | GetType | (Inherited from Object.)
Public method | ToString | (Inherited from ValueType.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Fields
 | Name | Description
Public field | dwAvailPageFile |
Public field | dwAvailPhys |
Public field | dwAvailVirtual |
Public field | dwLength |
Public field | dwMemoryLoad |
Public field | dwTotalPageFile |
Public field | dwTotalPhys |
Public field | dwTotalVirtual |
Top
See Also

Reference

Masuit.Tools.Hardware Namespace


MEMORY_INFO Fields

MEMORY_INFO Fields

The SystemInfoMEMORY_INFO type exposes the following members.

Fields
 | Name | Description
Public field | dwAvailPageFile |
Public field | dwAvailPhys |
Public field | dwAvailVirtual |
Public field | dwLength |
Public field | dwMemoryLoad |
Public field | dwTotalPageFile |
Public field | dwTotalPhys |
Public field | dwTotalVirtual |
Top
See Also

Reference

SystemInfoMEMORY_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.MEMORY_INFO.dwAvailPageFile Field

SystemInfoMEMORY_INFOdwAvailPageFile Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.MEMORY_INFO.dwAvailPageFile"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwAvailPageFile

Field Value

Type: UInt32
See Also

Reference

SystemInfoMEMORY_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.MEMORY_INFO.dwAvailPhys Field

SystemInfoMEMORY_INFOdwAvailPhys Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.MEMORY_INFO.dwAvailPhys"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwAvailPhys

Field Value

Type: UInt32
See Also

Reference

SystemInfoMEMORY_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.MEMORY_INFO.dwAvailVirtual Field

SystemInfoMEMORY_INFOdwAvailVirtual Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.MEMORY_INFO.dwAvailVirtual"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwAvailVirtual

Field Value

Type: UInt32
See Also

Reference

SystemInfoMEMORY_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.MEMORY_INFO.dwLength Field

SystemInfoMEMORY_INFOdwLength Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.MEMORY_INFO.dwLength"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwLength

Field Value

Type: UInt32
See Also

Reference

SystemInfoMEMORY_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.MEMORY_INFO.dwMemoryLoad Field

SystemInfoMEMORY_INFOdwMemoryLoad Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.MEMORY_INFO.dwMemoryLoad"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwMemoryLoad

Field Value

Type: UInt32
See Also

Reference

SystemInfoMEMORY_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.MEMORY_INFO.dwTotalPageFile Field

SystemInfoMEMORY_INFOdwTotalPageFile Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.MEMORY_INFO.dwTotalPageFile"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwTotalPageFile

Field Value

Type: UInt32
See Also

Reference

SystemInfoMEMORY_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.MEMORY_INFO.dwTotalPhys Field

SystemInfoMEMORY_INFOdwTotalPhys Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.MEMORY_INFO.dwTotalPhys"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwTotalPhys

Field Value

Type: UInt32
See Also

Reference

SystemInfoMEMORY_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.MEMORY_INFO.dwTotalVirtual Field

SystemInfoMEMORY_INFOdwTotalVirtual Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.MEMORY_INFO.dwTotalVirtual"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public uint dwTotalVirtual

Field Value

Type: UInt32
See Also

Reference

SystemInfoMEMORY_INFO Structure
Masuit.Tools.Hardware Namespace


MEMORY_INFO Methods

MEMORY_INFO Methods

The SystemInfoMEMORY_INFO type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from ValueType.)
Public method | GetHashCode | (Inherited from ValueType.)
Public method | GetType | (Inherited from Object.)
Public method | ToString | (Inherited from ValueType.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

SystemInfoMEMORY_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.RamInfo Class

SystemInfoRamInfo Class
内存条模型
Inheritance Hierarchy
SystemObject
Masuit.Tools.HardwareSystemInfoRamInfo

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class RamInfo

The SystemInfoRamInfo type exposes the following members.

Constructors
 | Name | Description
Public method | SystemInfoRamInfo | Initializes a new instance of the SystemInfoRamInfo class
Top
Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Properties
 | Name | Description
Public property | AvailablePageFile |
Public property | AvailableVirtual |
Public property | MemoryAvailable |
Public property | MemoryUsage |
Public property | PhysicalMemory |
Public property | TotalPageFile |
Public property | TotalVirtual |
Top
See Also

Reference

Masuit.Tools.Hardware Namespace


SystemInfo.RamInfo Constructor

SystemInfoRamInfo Constructor
Initializes a new instance of the SystemInfoRamInfo class

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public RamInfo()
See Also

Reference

SystemInfoRamInfo Class
Masuit.Tools.Hardware Namespace


RamInfo Methods

RamInfo Methods

The SystemInfoRamInfo type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

SystemInfoRamInfo Class
Masuit.Tools.Hardware Namespace


RamInfo Properties

RamInfo Properties

The SystemInfoRamInfo type exposes the following members.

Properties
 | Name | Description
Public property | AvailablePageFile |
Public property | AvailableVirtual |
Public property | MemoryAvailable |
Public property | MemoryUsage |
Public property | PhysicalMemory |
Public property | TotalPageFile |
Public property | TotalVirtual |
Top
See Also

Reference

SystemInfoRamInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.RamInfo.AvailablePageFile Property

SystemInfoRamInfoAvailablePageFile Property

[Missing <summary> documentation for "P:Masuit.Tools.Hardware.SystemInfo.RamInfo.AvailablePageFile"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double AvailablePageFile { get; set; }

Property Value

Type: Double
See Also

Reference

SystemInfoRamInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.RamInfo.AvailableVirtual Property

SystemInfoRamInfoAvailableVirtual Property

[Missing <summary> documentation for "P:Masuit.Tools.Hardware.SystemInfo.RamInfo.AvailableVirtual"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double AvailableVirtual { get; set; }

Property Value

Type: Double
See Also

Reference

SystemInfoRamInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.RamInfo.MemoryAvailable Property

SystemInfoRamInfoMemoryAvailable Property

[Missing <summary> documentation for "P:Masuit.Tools.Hardware.SystemInfo.RamInfo.MemoryAvailable"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double MemoryAvailable { get; set; }

Property Value

Type: Double
See Also

Reference

SystemInfoRamInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.RamInfo.MemoryUsage Property

SystemInfoRamInfoMemoryUsage Property

[Missing <summary> documentation for "P:Masuit.Tools.Hardware.SystemInfo.RamInfo.MemoryUsage"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double MemoryUsage { get; }

Property Value

Type: Double
See Also

Reference

SystemInfoRamInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.RamInfo.PhysicalMemory Property

SystemInfoRamInfoPhysicalMemory Property

[Missing <summary> documentation for "P:Masuit.Tools.Hardware.SystemInfo.RamInfo.PhysicalMemory"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double PhysicalMemory { get; set; }

Property Value

Type: Double
See Also

Reference

SystemInfoRamInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.RamInfo.TotalPageFile Property

SystemInfoRamInfoTotalPageFile Property

[Missing <summary> documentation for "P:Masuit.Tools.Hardware.SystemInfo.RamInfo.TotalPageFile"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double TotalPageFile { get; set; }

Property Value

Type: Double
See Also

Reference

SystemInfoRamInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.RamInfo.TotalVirtual Property

SystemInfoRamInfoTotalVirtual Property

[Missing <summary> documentation for "P:Masuit.Tools.Hardware.SystemInfo.RamInfo.TotalVirtual"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double TotalVirtual { get; set; }

Property Value

Type: Double
See Also

Reference

SystemInfoRamInfo Class
Masuit.Tools.Hardware Namespace


SystemInfo.SYSTEMTIME_INFO Structure

SystemInfoSYSTEMTIME_INFO Structure
定义系统时间的信息结构

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public struct SYSTEMTIME_INFO

The SystemInfoSYSTEMTIME_INFO type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from ValueType.)
Public method | GetHashCode | (Inherited from ValueType.)
Public method | GetType | (Inherited from Object.)
Public method | ToString | (Inherited from ValueType.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Fields
 | Name | Description
Public field | wDay |
Public field | wDayOfWeek |
Public field | wHour |
Public field | wMilliseconds |
Public field | wMinute |
Public field | wMonth |
Public field | wSecond |
Public field | wYear |
Top
See Also

Reference

Masuit.Tools.Hardware Namespace


SYSTEMTIME_INFO Fields

SYSTEMTIME_INFO Fields

The SystemInfoSYSTEMTIME_INFO type exposes the following members.

Fields
 | Name | Description
Public field | wDay |
Public field | wDayOfWeek |
Public field | wHour |
Public field | wMilliseconds |
Public field | wMinute |
Public field | wMonth |
Public field | wSecond |
Public field | wYear |
Top
See Also

Reference

SystemInfoSYSTEMTIME_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.SYSTEMTIME_INFO.wDay Field

SystemInfoSYSTEMTIME_INFOwDay Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.SYSTEMTIME_INFO.wDay"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public ushort wDay

Field Value

Type: UInt16
See Also

Reference

SystemInfoSYSTEMTIME_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.SYSTEMTIME_INFO.wDayOfWeek Field

SystemInfoSYSTEMTIME_INFOwDayOfWeek Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.SYSTEMTIME_INFO.wDayOfWeek"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public ushort wDayOfWeek

Field Value

Type: UInt16
See Also

Reference

SystemInfoSYSTEMTIME_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.SYSTEMTIME_INFO.wHour Field

SystemInfoSYSTEMTIME_INFOwHour Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.SYSTEMTIME_INFO.wHour"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public ushort wHour

Field Value

Type: UInt16
See Also

Reference

SystemInfoSYSTEMTIME_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.SYSTEMTIME_INFO.wMilliseconds Field

SystemInfoSYSTEMTIME_INFOwMilliseconds Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.SYSTEMTIME_INFO.wMilliseconds"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public ushort wMilliseconds

Field Value

Type: UInt16
See Also

Reference

SystemInfoSYSTEMTIME_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.SYSTEMTIME_INFO.wMinute Field

SystemInfoSYSTEMTIME_INFOwMinute Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.SYSTEMTIME_INFO.wMinute"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public ushort wMinute

Field Value

Type: UInt16
See Also

Reference

SystemInfoSYSTEMTIME_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.SYSTEMTIME_INFO.wMonth Field

SystemInfoSYSTEMTIME_INFOwMonth Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.SYSTEMTIME_INFO.wMonth"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public ushort wMonth

Field Value

Type: UInt16
See Also

Reference

SystemInfoSYSTEMTIME_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.SYSTEMTIME_INFO.wSecond Field

SystemInfoSYSTEMTIME_INFOwSecond Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.SYSTEMTIME_INFO.wSecond"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public ushort wSecond

Field Value

Type: UInt16
See Also

Reference

SystemInfoSYSTEMTIME_INFO Structure
Masuit.Tools.Hardware Namespace


SystemInfo.SYSTEMTIME_INFO.wYear Field

SystemInfoSYSTEMTIME_INFOwYear Field

[Missing <summary> documentation for "F:Masuit.Tools.Hardware.SystemInfo.SYSTEMTIME_INFO.wYear"]

Namespace: Masuit.Tools.Hardware
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public ushort wYear

Field Value

Type: UInt16
See Also

Reference

SystemInfoSYSTEMTIME_INFO Structure
Masuit.Tools.Hardware Namespace


SYSTEMTIME_INFO Methods

SYSTEMTIME_INFO Methods

The SystemInfoSYSTEMTIME_INFO type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from ValueType.)
Public method | GetHashCode | (Inherited from ValueType.)
Public method | GetType | (Inherited from Object.)
Public method | ToString | (Inherited from ValueType.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

SystemInfoSYSTEMTIME_INFO Structure
Masuit.Tools.Hardware Namespace


Masuit.Tools.Html Namespace

Masuit.Tools.Html Namespace

[Missing <summary> documentation for "N:Masuit.Tools.Html"]

Classes
Class Description
Public class HtmlPager
HTMl 分页
Public class HtmlTools
1、获取HTML
1.1获取指定页面的HTML代码 GetHtml(string url, string postData, bool isPost, CookieContainer cookieContainer)
1.2获取HTMLGetHtml(string url, CookieContainer cookieContainer)
2、获取字符流
2.1获取字符流GetStream(string url, CookieContainer cookieContainer)
3、清除HTML标记
3.1清除HTML标记 NoHTML(string Htmlstring)
4、匹配页面的链接
4.1获取页面的链接正则 GetHref(string HtmlCode)
5、匹配页面的图片地址
5.1匹配页面的图片地址 GetImgSrc(string HtmlCode, string imgHttp)
5.2匹配 [image] 中的图片路径实际链接 GetImg(string ImgString, string imgHttp)
6、抓取远程页面内容
6.1以GET方式抓取远程页面内容 Get_Http(string tUrl)
6.2以POST方式抓取远程页面内容 Post_Http(string url, string postData, string encodeType)
7、压缩HTML输出
7.1压缩HTML输出 ZipHtml(string Html)
8、过滤HTML标签
8.1过滤指定HTML标签 DelHtml(string s_TextStr, string html_Str)
8.2过滤HTML中的不安全标签 RemoveUnsafeHtml(string content)
HTML转行成TEXT HtmlToTxt(string strHtml)
字符串转换为 HtmlStringToHtml(string str)
html转换成字符串HtmlToString(string strHtml)
获取URL编码
判断URL是否有效
返回 HTML 字符串的编码解码结果
Public class ListBuilder
无序列表生成器
使用方式：
ListBuilder lb1=new ListBuilder("ul");
lb1.SetTemplate("<a href="{#url}" target="_blank"><strong>{#sortName}</strong> </a>\r\n{#lb2}");
ListBuilder lb2 = new ListBuilder("ul");
lb2.SetTemplate("<a href=url?tid={#id}" target=\"_blank\">{#title}</a> <span class='date'>[{#date}]</span>");
lb2.BindData(dt2);
或者
lb1.AddTemplateData("sortName", dr["sortName"].ToString());
lb1.AddTemplateData("url",url+"#sid."+dr["id"].ToString()+"/page.1/");
lb1.AddTemplateData("lb2",lb2.ToString());
lb1.EndTemplateData();
lSitemap.Text=lb1.ToString();
Enumerations
 | Enumeration | Description
Public enumeration | HtmlToolsPageType | 页面类型枚举


HtmlPager Class

HtmlPager Class
HTMl 分页
Inheritance Hierarchy
SystemObject
Masuit.Tools.HtmlHtmlPager

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class HtmlPager

The HtmlPager type exposes the following members.

Methods
Name | Description
GetHtmlPager | 写出分页
GetPager(Int32, Int32) | 写出分页
GetPager(Int32, Int32, String, String) | 写出分页
Paging(String, Int32, Int32, Int32) | 分页
Paging(String, String, Int32, Int32) | 分页
Paging(String, String, Int32, Int32, Int32) | 分页
Paging(String, String, Int32, Int32, UserControl) | 分页控件
paging2 | 带第一页和最后一页
Top
See Also

Reference

Masuit.Tools.Html Namespace


HtmlPager Methods

HtmlPager Methods

The HtmlPager type exposes the following members.

Methods
Name | Description
GetHtmlPager | 写出分页
GetPager(Int32, Int32) | 写出分页
GetPager(Int32, Int32, String, String) | 写出分页
Paging(String, Int32, Int32, Int32) | 分页
Paging(String, String, Int32, Int32) | 分页
Paging(String, String, Int32, Int32, Int32) | 分页
Paging(String, String, Int32, Int32, UserControl) | 分页控件
paging2 | 带第一页和最后一页
Top
See Also

Reference

HtmlPager Class
Masuit.Tools.Html Namespace


HtmlPager.GetHtmlPager Method

HtmlPagerGetHtmlPager Method
写出分页

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetHtmlPager(
    int pageCount,
    int currentPage,
    string prefix,
    string suffix
)

Parameters

pageCount
Type: SystemInt32
总页数
currentPage
Type: SystemInt32
当前页
prefix
Type: SystemString
上一页
suffix
Type: SystemString
下一页

Return Value

Type: String
分页栏
See Also

Reference

HtmlPager Class
Masuit.Tools.Html Namespace


HtmlPager.GetPager Method

HtmlPagerGetPager Method
Overload List
Name | Description
GetPager(Int32, Int32) | 写出分页
GetPager(Int32, Int32, String, String) | 写出分页
Top
See Also

Reference

HtmlPager Class
Masuit.Tools.Html Namespace


HtmlPager.GetPager Method (Int32, Int32)

HtmlPagerGetPager Method (Int32, Int32)
写出分页

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetPager(
    int pageCount,
    int currentPage
)

Parameters

pageCount
Type: SystemInt32
页数
currentPage
Type: SystemInt32
当前页

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlPager.GetPager(System.Int32,System.Int32)"]

See Also

Reference

HtmlPager Class
GetPager Overload
Masuit.Tools.Html Namespace


HtmlPager.GetPager Method (Int32, Int32, String[], String[])

HtmlPagerGetPager Method (Int32, Int32, String, String)
写出分页

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetPager(
    int pageCount,
    int currentPage,
    string[] FieldName,
    string[] FieldValue
)

Parameters

pageCount
Type: SystemInt32
页数
currentPage
Type: SystemInt32
当前页
FieldName
Type: SystemString
地址栏参数
FieldValue
Type: SystemString
地址栏参数值

Return Value

Type: String
分页栏
See Also

Reference

HtmlPager Class
GetPager Overload
Masuit.Tools.Html Namespace


HtmlPager.Paging Method

HtmlPagerPaging Method
Overload List
Name | Description
Paging(String, Int32, Int32, Int32) | 分页
Paging(String, String, Int32, Int32) | 分页
Paging(String, String, Int32, Int32, Int32) | 分页
Paging(String, String, Int32, Int32, UserControl) | 分页控件
Top
See Also

Reference

HtmlPager Class
Masuit.Tools.Html Namespace


HtmlPager.Paging Method (String, Int32, Int32, Int32)

HtmlPagerPaging Method (String, Int32, Int32, Int32)
分页

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Paging(
    string para,
    int sumpage,
    int page,
    int count
)

Parameters

para
Type: SystemString
参数
sumpage
Type: SystemInt32
总页数
page
Type: SystemInt32
当前页
count
Type: SystemInt32
总条数

Return Value

Type: String
当前页的内容
See Also

Reference

HtmlPager Class
Paging Overload
Masuit.Tools.Html Namespace


HtmlPager.Paging Method (String, String, Int32, Int32)

HtmlPagerPaging Method (String, String, Int32, Int32)
分页

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Paging(
    string url,
    string para,
    int sumpage,
    int page
)

Parameters

url
Type: SystemString
URL
para
Type: SystemString
参数
sumpage
Type: SystemInt32
总页数
page
Type: SystemInt32
当前页

Return Value

Type: String
当前页的内容
See Also

Reference

HtmlPager Class
Paging Overload
Masuit.Tools.Html Namespace


HtmlPager.Paging Method (String, String, Int32, Int32, Int32)

HtmlPagerPaging Method (String, String, Int32, Int32, Int32)
分页

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Paging(
    string url,
    string para,
    int sumpage,
    int page,
    int count
)

Parameters

url
Type: SystemString
URL
para
Type: SystemString
参数
sumpage
Type: SystemInt32
总页数
page
Type: SystemInt32
当前页
count
Type: SystemInt32
总条数

Return Value

Type: String
当前页的内容
See Also

Reference

HtmlPager Class
Paging Overload
Masuit.Tools.Html Namespace


HtmlPager.Paging Method (String, String, Int32, Int32, UserControl)

HtmlPagerPaging Method (String, String, Int32, Int32, UserControl)
分页控件

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Paging(
    string url,
    string para,
    int sumpage,
    int page,
    UserControl myPaging
)

Parameters

url
Type: SystemString
URL
para
Type: SystemString
参数
sumpage
Type: SystemInt32
总页数
page
Type: SystemInt32
当前页
myPaging
Type: System.Web.UIUserControl
分页控件

Return Value

Type: String
当前页的内容
See Also

Reference

HtmlPager Class
Paging Overload
Masuit.Tools.Html Namespace


HtmlPager.paging2 Method

HtmlPagerpaging2 Method
带第一页和最后一页

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string paging2(
    string para,
    int sumpage,
    int page,
    int count
)

Parameters

para
Type: SystemString
参数
sumpage
Type: SystemInt32
总页数
page
Type: SystemInt32
当前页
count
Type: SystemInt32
总条数

Return Value

Type: String
当前页的内容
See Also

Reference

HtmlPager Class
Masuit.Tools.Html Namespace


HtmlTools Class

HtmlTools Class
1、获取HTML
1.1获取指定页面的HTML代码 GetHtml(string url, string postData, bool isPost, CookieContainer cookieContainer)
1.2获取HTMLGetHtml(string url, CookieContainer cookieContainer)
2、获取字符流
2.1获取字符流GetStream(string url, CookieContainer cookieContainer)
3、清除HTML标记
3.1清除HTML标记 NoHTML(string Htmlstring)
4、匹配页面的链接
4.1获取页面的链接正则 GetHref(string HtmlCode)
5、匹配页面的图片地址
5.1匹配页面的图片地址 GetImgSrc(string HtmlCode, string imgHttp)
5.2匹配 [image] 中的图片路径实际链接 GetImg(string ImgString, string imgHttp)
6、抓取远程页面内容
6.1以GET方式抓取远程页面内容 Get_Http(string tUrl)
6.2以POST方式抓取远程页面内容 Post_Http(string url, string postData, string encodeType)
7、压缩HTML输出
7.1压缩HTML输出 ZipHtml(string Html)
8、过滤HTML标签
8.1过滤指定HTML标签 DelHtml(string s_TextStr, string html_Str)
8.2过滤HTML中的不安全标签 RemoveUnsafeHtml(string content)
HTML转行成TEXT HtmlToTxt(string strHtml)
字符串转换为 HtmlStringToHtml(string str)
html转换成字符串HtmlToString(string strHtml)
获取URL编码
判断URL是否有效
返回 HTML 字符串的编码解码结果
html工具类
Inheritance Hierarchy
SystemObject
Masuit.Tools.HtmlHtmlTools

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class HtmlTools

The HtmlTools type exposes the following members.

Methods
Name | Description
ClearHtml | 清理Word文档转html后的冗余标签属性
ClearTag(String) | 清除html标签
ClearTag(String, String) | 根据正则清除html标签
ConvertImgSrcToRelativePath | 将src的绝对路径换成相对路径
ConvertToJavascript | 将html转换成js代码
CSS | 加载CSS样式文件
DealWithFrame | 处理框架页面问题。如果该页面是框架结构的话，返回该框架
DealWithIFrame | 处理浮动桢问题。如果该页面存在浮动桢，返回浮动桢
DelHtml | 8.1过滤指定HTML标签
DelTag | 删除字符串中的特定标记
DelTagArray | 删除字符串中的一组标记
EncodeHtml | 替换html字符
File | 加载文件块
Get_Http | 6.1以GET方式抓取远程页面内容
GetAllLinkText | 4.3获取所有连接文本
GetAllURL | 4.2取得所有链接URL
GetAuthor | 作者名
GetBody(String) | 网页Body内容
GetBody(String, String) | 网页Body内容
GetBodyHelp | 网页Body内容
GetContent | 获取内容
GetCookieCollection | 获取Cookie集合
GetCreateDate | 获得发表日期、编码
GetDomain | 根据URL获得域名
GetDomainUrl | 获得主域
GetEncoding | 获取URL编码
GetHiddenKeyValue | 获取HTML页面内制定Key的Value内容
GetHref | 4.1获取页面的链接正则
GetHtml(String) | 网页内容
GetHtml(String, CookieContainer) | 获取HTML
GetHtml(String, String, Boolean, CookieContainer) | 获取指定页面的HTML代码
GetHtmlByUrl(String) | 根据超链接地址获取页面内容
GetHtmlByUrl(String, String) | 根据超链接地址获取页面内容
GetHtmlByUrl(String, String) | 根据超链接地址获取页面内容，并将url作为引用类型
GetHtmlByUrlList | 获得多个页面
GetHttpHead | 获取http报文头
GetImg | 匹配 [image] 中的图片路径实际链接
GetImgSrc(String) | 图片地址
GetImgSrc(String, String) | 匹配页面的图片地址
GetImgTag | 图片标签
GetKeyWord | 关键字
GetLink | 根据内容获得链接
GetLinkHelp | 单个链接
GetLinks | 多个链接
GetLinksFromRss(String, String) | 从RSS FEED中读取
GetLinksFromRss(String, String, DictionaryString, String) | 从RSS FEED中读取
GetList(String, String, Int32) | 多个匹配内容
GetList(String, String, String) | 多个匹配内容
GetListByReg | 根据标签获取数据集合
GetPageLinks | 分页链接地址
GetPageType | 获取页面类型
GetSource | 文章来源
GetStream | 2.1获取字符流
GetText(String, String, Int32) | 单个匹配内容
GetText(String, String, String) | 单个匹配内容
GetTextByLink | 根据链接得到文本
GetTextByReg(String, String) | 根据标签获取文本
GetTextByReg(String, String, String) | 根据标签获取文本
GetTextFromHTML | 从HTML中获取文本,保留br,p,img
GetTitle(String) | 网页标题
GetTitle(String, String) | 文章标题
GetTitleFromRss | 从RSS FEED中读取标题
GetTxtFromHtml | 从html中过滤出文本
GetTxtFromHtml2 | 从html中过滤出文本，不过保留换行符号
GetUrl | 根据相对路径得到绝对路径
GetUrlByRelative | 获得链接的绝对路径
GetUrlError | 判断URL是否有效
HtmlDecode | 返回 HTML 字符串的解码结果
HtmlEncode | 返回 HTML 字符串的编码结果
HtmlSantinizerCustom | 自定义的防止html的xss净化器
HtmlSantinizerStandard | 标准的防止html的xss净化器
HtmlToString | html转换成字符串
HtmlToTxt | HTML转行成TEXT HtmlToTxt(string strHtml)
IsExistsScriptLink | 判断是否是js链接
IsXml | 判断是否是xml格式
Javascript | 加载javascript脚本文件
MatchFirstImgSrc | 获取html中第一个img标签的src
MatchImgTag | 匹配html的img标签
MatchRandomImgSrc | 随机获取html代码中的img标签的src属性
Post_Http | 6.2以POST方式抓取远程页面内容
RemoveByReg | 根据标签进行移除
RemoveEndWith | 按结尾移除内容
RemoveHTML | 3.1清除HTML标记
RemoveHtmlTag | 去除html标签后并截取字符串
RemoveUnsafeHtml | 8.2过滤HTML中的不安全标签，去掉尖括号
Replace(String, String, String, Int32) | 替换指定内容
Replace(String, String, String, String) | 替换指定内容
ReplaceByReg | 根据正则表达式替换内容
ReplaceHtmlImgSource | 替换html的img路径为绝对路径
ReplaceStrToScript | Obsolete. 为脚本替换特殊字符串
Split | 分割指定内容
StrFormat | 替换回车换行符为html换行符
StringToHtml | 字符串转换为 HtmlStringToHtml(string str)
ZipHtml | 7.1压缩HTML输出
Top
Properties
Name | Description
CookieContainer | Cookie容器
Encoding | 获取网页源码时使用的编码
MaxTry | 最大尝试次数
NetworkDelay | 网络延迟
Top
See Also

Reference

Masuit.Tools.Html Namespace


HtmlTools Methods

HtmlTools Methods

The HtmlTools type exposes the following members.

Methods
Name | Description
ClearHtml | 清理Word文档转html后的冗余标签属性
ClearTag(String) | 清除html标签
ClearTag(String, String) | 根据正则清除html标签
ConvertImgSrcToRelativePath | 将src的绝对路径换成相对路径
ConvertToJavascript | 将html转换成js代码
CSS | 加载CSS样式文件
DealWithFrame | 处理框架页面问题。如果该页面是框架结构的话，返回该框架
DealWithIFrame | 处理浮动桢问题。如果该页面存在浮动桢，返回浮动桢
DelHtml | 8.1过滤指定HTML标签
DelTag | 删除字符串中的特定标记
DelTagArray | 删除字符串中的一组标记
EncodeHtml | 替换html字符
File | 加载文件块
Get_Http | 6.1以GET方式抓取远程页面内容
GetAllLinkText | 4.3获取所有连接文本
GetAllURL | 4.2取得所有链接URL
GetAuthor | 作者名
GetBody(String) | 网页Body内容
GetBody(String, String) | 网页Body内容
GetBodyHelp | 网页Body内容
GetContent | 获取内容
GetCookieCollection | 获取Cookie集合
GetCreateDate | 获得发表日期、编码
GetDomain | 根据URL获得域名
GetDomainUrl | 获得主域
GetEncoding | 获取URL编码
GetHiddenKeyValue | 获取HTML页面内制定Key的Value内容
GetHref | 4.1获取页面的链接正则
GetHtml(String) | 网页内容
GetHtml(String, CookieContainer) | 获取HTML
GetHtml(String, String, Boolean, CookieContainer) | 获取指定页面的HTML代码
GetHtmlByUrl(String) | 根据超链接地址获取页面内容
GetHtmlByUrl(String, String) | 根据超链接地址获取页面内容
GetHtmlByUrl(String, String) | 根据超链接地址获取页面内容，并将url作为引用类型
GetHtmlByUrlList | 获得多个页面
GetHttpHead | 获取http报文头
GetImg | 匹配 [image] 中的图片路径实际链接
GetImgSrc(String) | 图片地址
GetImgSrc(String, String) | 匹配页面的图片地址
GetImgTag | 图片标签
GetKeyWord | 关键字
GetLink | 根据内容获得链接
GetLinkHelp | 单个链接
GetLinks | 多个链接
GetLinksFromRss(String, String) | 从RSS FEED中读取
GetLinksFromRss(String, String, DictionaryString, String) | 从RSS FEED中读取
GetList(String, String, Int32) | 多个匹配内容
GetList(String, String, String) | 多个匹配内容
GetListByReg | 根据标签获取数据集合
GetPageLinks | 分页链接地址
GetPageType | 获取页面类型
GetSource | 文章来源
GetStream | 2.1获取字符流
GetText(String, String, Int32) | 单个匹配内容
GetText(String, String, String) | 单个匹配内容
GetTextByLink | 根据链接得到文本
GetTextByReg(String, String) | 根据标签获取文本
GetTextByReg(String, String, String) | 根据标签获取文本
GetTextFromHTML | 从HTML中获取文本,保留br,p,img
GetTitle(String) | 网页标题
GetTitle(String, String) | 文章标题
GetTitleFromRss | 从RSS FEED中读取标题
GetTxtFromHtml | 从html中过滤出文本
GetTxtFromHtml2 | 从html中过滤出文本，不过保留换行符号
GetUrl | 根据相对路径得到绝对路径
GetUrlByRelative | 获得链接的绝对路径
GetUrlError | 判断URL是否有效
HtmlDecode | 返回 HTML 字符串的解码结果
HtmlEncode | 返回 HTML 字符串的编码结果
HtmlSantinizerCustom | 自定义的防止html的xss净化器
HtmlSantinizerStandard | 标准的防止html的xss净化器
HtmlToString | html转换成字符串
HtmlToTxt | HTML转行成TEXT HtmlToTxt(string strHtml)
IsExistsScriptLink | 判断是否是js链接
IsXml | 判断是否是xml格式
Javascript | 加载javascript脚本文件
MatchFirstImgSrc | 获取html中第一个img标签的src
MatchImgTag | 匹配html的img标签
MatchRandomImgSrc | 随机获取html代码中的img标签的src属性
Post_Http | 6.2以POST方式抓取远程页面内容
RemoveByReg | 根据标签进行移除
RemoveEndWith | 按结尾移除内容
RemoveHTML | 3.1清除HTML标记
RemoveHtmlTag | 去除html标签后并截取字符串
RemoveUnsafeHtml | 8.2过滤HTML中的不安全标签，去掉尖括号
Replace(String, String, String, Int32) | 替换指定内容
Replace(String, String, String, String) | 替换指定内容
ReplaceByReg | 根据正则表达式替换内容
ReplaceHtmlImgSource | 替换html的img路径为绝对路径
ReplaceStrToScript | Obsolete. 为脚本替换特殊字符串
Split | 分割指定内容
StrFormat | 替换回车换行符为html换行符
StringToHtml | 字符串转换为 HtmlStringToHtml(string str)
ZipHtml | 7.1压缩HTML输出
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.ClearHtml Method

HtmlToolsClearHtml Method
清理Word文档转html后的冗余标签属性

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ClearHtml(
    this string html
)

Parameters

html
Type: SystemString

[Missing <param name="html"/> documentation for "M:Masuit.Tools.Html.HtmlTools.ClearHtml(System.String)"]

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.ClearHtml(System.String)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.ClearTag Method

HtmlToolsClearTag Method
Overload List
Name | Description
ClearTag(String) | 清除html标签
ClearTag(String, String) | 根据正则清除html标签
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.ClearTag Method (String)

HtmlToolsClearTag Method (String)
清除html标签

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ClearTag(
    string sHtml
)

Parameters

sHtml
Type: SystemString
html代码

Return Value

Type: String
清理后的内容
See Also

Reference

HtmlTools Class
ClearTag Overload
Masuit.Tools.Html Namespace


HtmlTools.ClearTag Method (String, String)

HtmlToolsClearTag Method (String, String)
根据正则清除html标签

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ClearTag(
    string sHtml,
    string sRegex
)

Parameters

sHtml
Type: SystemString
html代码
sRegex
Type: SystemString
正则表达式

Return Value

Type: String
清理后的内容
See Also

Reference

HtmlTools Class
ClearTag Overload
Masuit.Tools.Html Namespace


HtmlTools.ConvertImgSrcToRelativePath Method

HtmlToolsConvertImgSrcToRelativePath Method
将src的绝对路径换成相对路径

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ConvertImgSrcToRelativePath(
    this string s
)

Parameters

s
Type: SystemString

[Missing <param name="s"/> documentation for "M:Masuit.Tools.Html.HtmlTools.ConvertImgSrcToRelativePath(System.String)"]

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.ConvertImgSrcToRelativePath(System.String)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.ConvertToJavascript Method

HtmlToolsConvertToJavascript Method
将html转换成js代码

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ConvertToJavascript(
    string sHtml
)

Parameters

sHtml
Type: SystemString
html代码

Return Value

Type: String
js代码
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.CSS Method

HtmlToolsCSS Method
加载CSS样式文件

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string CSS(
    string cssPath,
    Page p
)

Parameters

cssPath
Type: SystemString
css路径
p
Type: System.Web.UIPage
Page页

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.CSS(System.String,System.Web.UI.Page)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.DealWithFrame Method

HtmlToolsDealWithFrame Method
处理框架页面问题。如果该页面是框架结构的话，返回该框架

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string[] DealWithFrame(
    string url,
    string content
)

Parameters

url
Type: SystemString
URL
content
Type: SystemString
内容

Return Value

Type: String
框架结构
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.DealWithIFrame Method

HtmlToolsDealWithIFrame Method
处理浮动桢问题。如果该页面存在浮动桢，返回浮动桢

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string[] DealWithIFrame(
    string url,
    string content
)

Parameters

url
Type: SystemString
URL
content
Type: SystemString
内容

Return Value

Type: String
浮动桢
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.DelHtml Method

HtmlToolsDelHtml Method
8.1过滤指定HTML标签

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DelHtml(
    string s_TextStr,
    string html_Str
)

Parameters

s_TextStr
Type: SystemString
要过滤的字符
html_Str
Type: SystemString
a img p div

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.DelHtml(System.String,System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.DelTag Method

HtmlToolsDelTag Method
删除字符串中的特定标记

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DelTag(
    string str,
    string tag,
    bool isContent
)

Parameters

str
Type: SystemString
html代码
tag
Type: SystemString
指定的标记
isContent
Type: SystemBoolean
是否清除内容

Return Value

Type: String
清理后的代码
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.DelTagArray Method

HtmlToolsDelTagArray Method
删除字符串中的一组标记

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DelTagArray(
    string str,
    string tagA,
    bool isContent
)

Parameters

str
Type: SystemString
html代码
tagA
Type: SystemString
标记
isContent
Type: SystemBoolean
是否清除内容

Return Value

Type: String
清理后的代码
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.EncodeHtml Method

HtmlToolsEncodeHtml Method
替换html字符

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string EncodeHtml(
    string strHtml
)

Parameters

strHtml
Type: SystemString
html

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.EncodeHtml(System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.File Method

HtmlToolsFile Method
加载文件块

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string File(
    string Path,
    Page p
)

Parameters

Path
Type: SystemString
文件路径
p
Type: System.Web.UIPage
Page页

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.File(System.String,System.Web.UI.Page)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.Get_Http Method

HtmlToolsGet_Http Method
6.1以GET方式抓取远程页面内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Get_Http(
    string tUrl
)

Parameters

tUrl
Type: SystemString
URL

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.Get_Http(System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetAllLinkText Method

HtmlToolsGetAllLinkText Method
4.3获取所有连接文本

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetAllLinkText(
    string html
)

Parameters

html
Type: SystemString
html代码

Return Value

Type: String
所有的带链接的a标签
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetAllURL Method

HtmlToolsGetAllURL Method
4.2取得所有链接URL

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetAllURL(
    string html
)

Parameters

html
Type: SystemString
html代码

Return Value

Type: String
提取到的url
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetAuthor Method

HtmlToolsGetAuthor Method
作者名

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetAuthor(
    string sInput,
    string sRegex
)

Parameters

sInput
Type: SystemString
输入内容
sRegex
Type: SystemString
表达式字符串

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetAuthor(System.String,System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetBody Method

HtmlToolsGetBody Method
Overload List
Name | Description
GetBody(String) | 网页Body内容
GetBody(String, String) | 网页Body内容
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetBody Method (String)

HtmlToolsGetBody Method (String)
网页Body内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetBody(
    string sContent
)

Parameters

sContent
Type: SystemString
html源代码

Return Value

Type: String
网页Body内容
See Also

Reference

HtmlTools Class
GetBody Overload
Masuit.Tools.Html Namespace


HtmlTools.GetBody Method (String, String)

HtmlToolsGetBody Method (String, String)
网页Body内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetBody(
    string sInput,
    string sRegex
)

Parameters

sInput
Type: SystemString
输入内容
sRegex
Type: SystemString
表达式字符串

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetBody(System.String,System.String)"]

See Also

Reference

HtmlTools Class
GetBody Overload
Masuit.Tools.Html Namespace


HtmlTools.GetBodyHelp Method

HtmlToolsGetBodyHelp Method
网页Body内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetBodyHelp(
    string sInput
)

Parameters

sInput
Type: SystemString
html

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetBodyHelp(System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetContent Method

HtmlToolsGetContent Method
获取内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetContent(
    string sOriContent,
    string sOtherRemoveReg,
    string sPageUrl,
    DataTable dtAntiLink
)

Parameters

sOriContent
Type: SystemString
原始数据
sOtherRemoveReg
Type: SystemString
需要移除的字符
sPageUrl
Type: SystemString
URL
dtAntiLink
Type: System.DataDataTable
反链 表数据

Return Value

Type: String
转码后的内容
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetCookieCollection Method

HtmlToolsGetCookieCollection Method
获取Cookie集合

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static CookieCollection GetCookieCollection(
    string cookieString
)

Parameters

cookieString
Type: SystemString
Cookie的键

Return Value

Type: CookieCollection
Cookie键值集合
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetCreateDate Method

HtmlToolsGetCreateDate Method
获得发表日期、编码

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static DateTime GetCreateDate(
    string sContent,
    string sRegex
)

Parameters

sContent
Type: SystemString
内容
sRegex
Type: SystemString
正则表达式

Return Value

Type: DateTime
日期
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetDomain Method

HtmlToolsGetDomain Method
根据URL获得域名

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetDomain(
    string sInput
)

Parameters

sInput
Type: SystemString
输入内容

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetDomain(System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetDomainUrl Method

HtmlToolsGetDomainUrl Method
获得主域

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetDomainUrl(
    string sUrl
)

Parameters

sUrl
Type: SystemString
URL

Return Value

Type: String
域名
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetEncoding Method

HtmlToolsGetEncoding Method
获取URL编码

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetEncoding(
    string url
)

Parameters

url
Type: SystemString
URL

Return Value

Type: String
编码类型
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetHiddenKeyValue Method

HtmlToolsGetHiddenKeyValue Method
获取HTML页面内制定Key的Value内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetHiddenKeyValue(
    string html,
    string key
)

Parameters

html
Type: SystemString
html源代码
key
Type: SystemString
键

Return Value

Type: String
获取到的值
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetHref Method

HtmlToolsGetHref Method
4.1获取页面的链接正则

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetHref(
    string HtmlCode
)

Parameters

HtmlCode
Type: SystemString
html代码

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetHref(System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetHtml Method

HtmlToolsGetHtml Method
Overload List
Name | Description
GetHtml(String) | 网页内容
GetHtml(String, CookieContainer) | 获取HTML
GetHtml(String, String, Boolean, CookieContainer) | 获取指定页面的HTML代码
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetHtml Method (String)

HtmlToolsGetHtml Method (String)
网页内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetHtml(
    string sInput
)

Parameters

sInput
Type: SystemString
输入内容

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetHtml(System.String)"]

See Also

Reference

HtmlTools Class
GetHtml Overload
Masuit.Tools.Html Namespace


HtmlTools.GetHtml Method (String, CookieContainer)

HtmlToolsGetHtml Method (String, CookieContainer)
获取HTML

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetHtml(
    string url,
    CookieContainer cookieContainer
)

Parameters

url
Type: SystemString
地址
cookieContainer
Type: System.NetCookieContainer
Cookie集合

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetHtml(System.String,System.Net.CookieContainer)"]

See Also

Reference

HtmlTools Class
GetHtml Overload
Masuit.Tools.Html Namespace


HtmlTools.GetHtml Method (String, String, Boolean, CookieContainer)

HtmlToolsGetHtml Method (String, String, Boolean, CookieContainer)
获取指定页面的HTML代码

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetHtml(
    string url,
    string postData,
    bool isPost,
    CookieContainer cookieContainer
)

Parameters

url
Type: SystemString
指定页面的路径
postData
Type: SystemString
post 提交的字符串
isPost
Type: SystemBoolean
是否以post方式发送请求
cookieContainer
Type: System.NetCookieContainer
Cookie集合

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetHtml(System.String,System.String,System.Boolean,System.Net.CookieContainer)"]

See Also

Reference

HtmlTools Class
GetHtml Overload
Masuit.Tools.Html Namespace


HtmlTools.GetHtmlByUrl Method

HtmlToolsGetHtmlByUrl Method
Overload List
Name | Description
GetHtmlByUrl(String) | 根据超链接地址获取页面内容
GetHtmlByUrl(String, String) | 根据超链接地址获取页面内容
GetHtmlByUrl(String, String) | 根据超链接地址获取页面内容，并将url作为引用类型
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetHtmlByUrl Method (String)

HtmlToolsGetHtmlByUrl Method (String)
根据超链接地址获取页面内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetHtmlByUrl(
    string sUrl
)

Parameters

sUrl
Type: SystemString
URL

Return Value

Type: String
页面内容
See Also

Reference

HtmlTools Class
GetHtmlByUrl Overload
Masuit.Tools.Html Namespace


HtmlTools.GetHtmlByUrl Method (String, String)

HtmlToolsGetHtmlByUrl Method (String, String)
根据超链接地址获取页面内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetHtmlByUrl(
    string sUrl,
    string sCoding
)

Parameters

sUrl
Type: SystemString
URL
sCoding
Type: SystemString
文件编码

Return Value

Type: String
页面内容
See Also

Reference

HtmlTools Class
GetHtmlByUrl Overload
Masuit.Tools.Html Namespace


HtmlTools.GetHtmlByUrl Method (String, String)

HtmlToolsGetHtmlByUrl Method (String, String)
根据超链接地址获取页面内容，并将url作为引用类型

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetHtmlByUrl(
    ref string sUrl,
    string sCoding
)

Parameters

sUrl
Type: SystemString
URL
sCoding
Type: SystemString
文件编码

Return Value

Type: String
页面内容
See Also

Reference

HtmlTools Class
GetHtmlByUrl Overload
Masuit.Tools.Html Namespace


HtmlTools.GetHtmlByUrlList Method

HtmlToolsGetHtmlByUrlList Method
获得多个页面

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static List<KeyValuePair<int, string>> GetHtmlByUrlList(
    List<KeyValuePair<int, string>> listUrl,
    string sCoding
)

Parameters

listUrl
Type: System.Collections.GenericList KeyValuePair Int32, String
URL集合
sCoding
Type: SystemString
文件编码

Return Value

Type: List KeyValuePair Int32, String
页面集合
Exceptions
Exception | Condition
Exception |
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetHttpHead Method

HtmlToolsGetHttpHead Method
获取http报文头

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetHttpHead(
    string sUrl
)

Parameters

sUrl
Type: SystemString
URL

Return Value

Type: String
报文信息
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetImg Method

HtmlToolsGetImg Method
匹配 [image] 中的图片路径实际链接

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetImg(
    string ImgString,
    string imgHttp
)

Parameters

ImgString
Type: SystemString
字符串
imgHttp
Type: SystemString
图片路径

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetImg(System.String,System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetImgSrc Method

HtmlToolsGetImgSrc Method
Overload List
Name | Description
GetImgSrc(String) | 图片地址
GetImgSrc(String, String) | 匹配页面的图片地址
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetImgSrc Method (String)

HtmlToolsGetImgSrc Method (String)
图片地址

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetImgSrc(
    string sInput
)

Parameters

sInput
Type: SystemString
输入内容

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetImgSrc(System.String)"]

See Also

Reference

HtmlTools Class
GetImgSrc Overload
Masuit.Tools.Html Namespace


HtmlTools.GetImgSrc Method (String, String)

HtmlToolsGetImgSrc Method (String, String)
匹配页面的图片地址

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetImgSrc(
    string HtmlCode,
    string imgHttp
)

Parameters

HtmlCode
Type: SystemString
html代码
imgHttp
Type: SystemString
要补充的http://路径信息

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetImgSrc(System.String,System.String)"]

See Also

Reference

HtmlTools Class
GetImgSrc Overload
Masuit.Tools.Html Namespace


HtmlTools.GetImgTag Method

HtmlToolsGetImgTag Method
图片标签

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static List<string> GetImgTag(
    string sInput
)

Parameters

sInput
Type: SystemString
输入内容

Return Value

Type: List String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetImgTag(System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetKeyWord Method

HtmlToolsGetKeyWord Method
关键字

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetKeyWord(
    string sInput
)

Parameters

sInput
Type: SystemString
输入内容

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetKeyWord(System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetLink Method

HtmlToolsGetLink Method
根据内容获得链接

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetLink(
    string sContent
)

Parameters

sContent
Type: SystemString
html代码

Return Value

Type: String
链接
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetLinkHelp Method

HtmlToolsGetLinkHelp Method
单个链接

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetLinkHelp(
    string sInput
)

Parameters

sInput
Type: SystemString
输入内容

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetLinkHelp(System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetLinks Method

HtmlToolsGetLinks Method
多个链接

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static List<string> GetLinks(
    string sInput
)

Parameters

sInput
Type: SystemString
输入内容

Return Value

Type: List String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetLinks(System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetLinksFromRss Method

HtmlToolsGetLinksFromRss Method
Overload List
Name | Description
GetLinksFromRss(String, String) | 从RSS FEED中读取
GetLinksFromRss(String, String, DictionaryString, String) | 从RSS FEED中读取
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetLinksFromRss Method (String, String)

HtmlToolsGetLinksFromRss Method (String, String)
从RSS FEED中读取

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Dictionary<string, string> GetLinksFromRss(
    string sContent,
    string sUrl
)

Parameters

sContent
Type: SystemString
RSS内容
sUrl
Type: SystemString
URL

Return Value

Type: Dictionary String, String
读取到的内容
See Also

Reference

HtmlTools Class
GetLinksFromRss Overload
Masuit.Tools.Html Namespace


HtmlTools.GetLinksFromRss Method (String, String, Dictionary(String, String))

HtmlToolsGetLinksFromRss Method (String, String, DictionaryString, String)
从RSS FEED中读取

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Dictionary<string, string> GetLinksFromRss(
    string sContent,
    string sUrl,
    ref Dictionary<string, string> lisDes
)

Parameters

sContent
Type: SystemString
RSS内容
sUrl
Type: SystemString
URL
lisDes
Type: System.Collections.GenericDictionary String, String
过滤条件

Return Value

Type: Dictionary String, String
读取到的内容
See Also

Reference

HtmlTools Class
GetLinksFromRss Overload
Masuit.Tools.Html Namespace


HtmlTools.GetList Method

HtmlToolsGetList Method
Overload List
Name | Description
GetList(String, String, Int32) | 多个匹配内容
GetList(String, String, String) | 多个匹配内容
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetList Method (String, String, Int32)

HtmlToolsGetList Method (String, String, Int32)
多个匹配内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static List<string> GetList(
    string sInput,
    string sRegex,
    int iGroupIndex
)

Parameters

sInput
Type: SystemString
输入内容
sRegex
Type: SystemString
表达式字符串
iGroupIndex
Type: SystemInt32
第几个分组, 从1开始, 0代表不分组

Return Value

Type: List String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetList(System.String,System.String,System.Int32)"]

See Also

Reference

HtmlTools Class
GetList Overload
Masuit.Tools.Html Namespace


HtmlTools.GetList Method (String, String, String)

HtmlToolsGetList Method (String, String, String)
多个匹配内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static List<string> GetList(
    string sInput,
    string sRegex,
    string sGroupName
)

Parameters

sInput
Type: SystemString
输入内容
sRegex
Type: SystemString
表达式字符串
sGroupName
Type: SystemString
分组名, ""代表不分组

Return Value

Type: List String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetList(System.String,System.String,System.String)"]

See Also

Reference

HtmlTools Class
GetList Overload
Masuit.Tools.Html Namespace


HtmlTools.GetListByReg Method

HtmlToolsGetListByReg Method
根据标签获取数据集合

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static List<string> GetListByReg(
    string sContent,
    string sRegex
)

Parameters

sContent
Type: SystemString
html
sRegex
Type: SystemString
正则表达式

Return Value

Type: List String
数据集合
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetPageLinks Method

HtmlToolsGetPageLinks Method
分页链接地址

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static List<string> GetPageLinks(
    string sInput,
    string sRegex
)

Parameters

sInput
Type: SystemString
输入内容
sRegex
Type: SystemString
表达式字符串

Return Value

Type: List String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetPageLinks(System.String,System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetPageType Method

HtmlToolsGetPageType Method
获取页面类型

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static HtmlToolsPageType GetPageType(
    string sUrl,
    ref string sHtml
)

Parameters

sUrl
Type: SystemString
URL
sHtml
Type: SystemString
内容

Return Value

Type: HtmlToolsPageType
页面类型枚举
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetSource Method

HtmlToolsGetSource Method
文章来源

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetSource(
    string sInput,
    string sRegex
)

Parameters

sInput
Type: SystemString
输入内容
sRegex
Type: SystemString
表达式字符串

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetSource(System.String,System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetStream Method

HtmlToolsGetStream Method
2.1获取字符流

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Stream GetStream(
    string url,
    CookieContainer cookieContainer
)

Parameters

url
Type: SystemString
地址
cookieContainer
Type: System.NetCookieContainer
cookieContainer

Return Value

Type: Stream

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetStream(System.String,System.Net.CookieContainer)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetText Method

HtmlToolsGetText Method
Overload List
Name | Description
GetText(String, String, Int32) | 单个匹配内容
GetText(String, String, String) | 单个匹配内容
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetText Method (String, String, Int32)

HtmlToolsGetText Method (String, String, Int32)
单个匹配内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetText(
    string sInput,
    string sRegex,
    int iGroupIndex
)

Parameters

sInput
Type: SystemString
输入内容
sRegex
Type: SystemString
表达式字符串
iGroupIndex
Type: SystemInt32
分组序号, 从1开始, 0不分组

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetText(System.String,System.String,System.Int32)"]

See Also

Reference

HtmlTools Class
GetText Overload
Masuit.Tools.Html Namespace


HtmlTools.GetText Method (String, String, String)

HtmlToolsGetText Method (String, String, String)
单个匹配内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetText(
    string sInput,
    string sRegex,
    string sGroupName
)

Parameters

sInput
Type: SystemString
输入内容
sRegex
Type: SystemString
表达式字符串
sGroupName
Type: SystemString
分组名, ""代表不分组

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetText(System.String,System.String,System.String)"]

See Also

Reference

HtmlTools Class
GetText Overload
Masuit.Tools.Html Namespace


HtmlTools.GetTextByLink Method

HtmlToolsGetTextByLink Method
根据链接得到文本

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetTextByLink(
    string sContent
)

Parameters

sContent
Type: SystemString
链接

Return Value

Type: String
文本
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetTextByReg Method

HtmlToolsGetTextByReg Method
Overload List
Name | Description
GetTextByReg(String, String) | 根据标签获取文本
GetTextByReg(String, String, String) | 根据标签获取文本
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetTextByReg Method (String, String)

HtmlToolsGetTextByReg Method (String, String)
根据标签获取文本

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetTextByReg(
    string sContent,
    string sRegex
)

Parameters

sContent
Type: SystemString
html
sRegex
Type: SystemString
正则表达式

Return Value

Type: String
文本
See Also

Reference

HtmlTools Class
GetTextByReg Overload
Masuit.Tools.Html Namespace


HtmlTools.GetTextByReg Method (String, String, String)

HtmlToolsGetTextByReg Method (String, String, String)
根据标签获取文本

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetTextByReg(
    string sContent,
    string sRegex,
    string sGroupName
)

Parameters

sContent
Type: SystemString
html
sRegex
Type: SystemString
正则表达式
sGroupName
Type: SystemString
分组名

Return Value

Type: String
文本
See Also

Reference

HtmlTools Class
GetTextByReg Overload
Masuit.Tools.Html Namespace


HtmlTools.GetTextFromHTML Method

HtmlToolsGetTextFromHTML Method
从HTML中获取文本,保留br,p,img

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetTextFromHTML(
    string HTML
)

Parameters

HTML
Type: SystemString
html代码

Return Value

Type: String
保留br,p,img的文本
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetTitle Method

HtmlToolsGetTitle Method
Overload List
Name | Description
GetTitle(String) | 网页标题
GetTitle(String, String) | 文章标题
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetTitle Method (String)

HtmlToolsGetTitle Method (String)
网页标题

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetTitle(
    string sInput
)

Parameters

sInput
Type: SystemString
html

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetTitle(System.String)"]

See Also

Reference

HtmlTools Class
GetTitle Overload
Masuit.Tools.Html Namespace


HtmlTools.GetTitle Method (String, String)

HtmlToolsGetTitle Method (String, String)
文章标题

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetTitle(
    string sInput,
    string sRegex
)

Parameters

sInput
Type: SystemString
输入内容
sRegex
Type: SystemString
表达式字符串

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetTitle(System.String,System.String)"]

See Also

Reference

HtmlTools Class
GetTitle Overload
Masuit.Tools.Html Namespace


HtmlTools.GetTitleFromRss Method

HtmlToolsGetTitleFromRss Method
从RSS FEED中读取标题

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetTitleFromRss(
    string sContent
)

Parameters

sContent
Type: SystemString
RSS

Return Value

Type: String
标题
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetTxtFromHtml Method

HtmlToolsGetTxtFromHtml Method
从html中过滤出文本

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetTxtFromHtml(
    string sHtml
)

Parameters

sHtml
Type: SystemString
html

Return Value

Type: String
纯文本
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetTxtFromHtml2 Method

HtmlToolsGetTxtFromHtml2 Method
从html中过滤出文本，不过保留换行符号

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetTxtFromHtml2(
    string sHtml
)

Parameters

sHtml
Type: SystemString
html源代码

Return Value

Type: String
从html中过滤出文本，不过保留换行符号
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetUrl Method

HtmlToolsGetUrl Method
根据相对路径得到绝对路径

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetUrl(
    string sInput,
    string sRelativeUrl
)

Parameters

sInput
Type: SystemString
原始网站地址
sRelativeUrl
Type: SystemString
相对链接地址

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.GetUrl(System.String,System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetUrlByRelative Method

HtmlToolsGetUrlByRelative Method
获得链接的绝对路径

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetUrlByRelative(
    string sUrl,
    string sRUrl
)

Parameters

sUrl
Type: SystemString
原链接地址
sRUrl
Type: SystemString
相对地址

Return Value

Type: String
获得链接的绝对路径
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.GetUrlError Method

HtmlToolsGetUrlError Method
判断URL是否有效

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int GetUrlError(
    string url
)

Parameters

url
Type: SystemString
待判断的URL，可以是网页以及图片链接等

Return Value

Type: Int32
200为正确，其余为大致网页错误代码
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.HtmlDecode Method

HtmlToolsHtmlDecode Method
返回 HTML 字符串的解码结果

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string HtmlDecode(
    string str
)

Parameters

str
Type: SystemString
字符串

Return Value

Type: String
解码结果
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.HtmlEncode Method

HtmlToolsHtmlEncode Method
返回 HTML 字符串的编码结果

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string HtmlEncode(
    string inputData
)

Parameters

inputData
Type: SystemString
字符串

Return Value

Type: String
编码结果
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.HtmlSantinizerCustom Method

HtmlToolsHtmlSantinizerCustom Method
自定义的防止html的xss净化器

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string HtmlSantinizerCustom(
    this string html,
    string[] labels = null,
    string[] attributes = null,
    string[] styles = null
)

Parameters

html
Type: SystemString
源html
labels (Optional)
Type: SystemString
需要移除的标签集合
attributes (Optional)
Type: SystemString
需要移除的属性集合
styles (Optional)
Type: SystemString
需要移除的样式集合

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.HtmlSantinizerCustom(System.String,System.String[],System.String[],System.String[])"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.HtmlSantinizerStandard Method

HtmlToolsHtmlSantinizerStandard Method
标准的防止html的xss净化器

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string HtmlSantinizerStandard(
    this string html
)

Parameters

html
Type: SystemString

[Missing <param name="html"/> documentation for "M:Masuit.Tools.Html.HtmlTools.HtmlSantinizerStandard(System.String)"]

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.HtmlSantinizerStandard(System.String)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.HtmlToString Method

HtmlToolsHtmlToString Method
html转换成字符串

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string HtmlToString(
    string strHtml
)

Parameters

strHtml
Type: SystemString
html代码

Return Value

Type: String
安全的字符串
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.HtmlToTxt Method

HtmlToolsHtmlToTxt Method
HTML转行成TEXT HtmlToTxt(string strHtml)

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string HtmlToTxt(
    string strHtml
)

Parameters

strHtml
Type: SystemString
html代码

Return Value

Type: String
普通文本
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.IsExistsScriptLink Method

HtmlToolsIsExistsScriptLink Method
判断是否是js链接

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool IsExistsScriptLink(
    string sHtml
)

Parameters

sHtml
Type: SystemString
html

Return Value

Type: Boolean
判断是否是js链接
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.IsXml Method

HtmlToolsIsXml Method
判断是否是xml格式

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool IsXml(
    string sFormartted
)

Parameters

sFormartted
Type: SystemString
输入内容

Return Value

Type: Boolean
是否是xml数据
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.Javascript Method

HtmlToolsJavascript Method
加载javascript脚本文件

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Javascript(
    string jsPath,
    Page p
)

Parameters

jsPath
Type: SystemString
js路径
p
Type: System.Web.UIPage
web页面

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.Javascript(System.String,System.Web.UI.Page)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.MatchFirstImgSrc Method

HtmlToolsMatchFirstImgSrc Method
获取html中第一个img标签的src

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string MatchFirstImgSrc(
    this string html
)

Parameters

html
Type: SystemString

[Missing <param name="html"/> documentation for "M:Masuit.Tools.Html.HtmlTools.MatchFirstImgSrc(System.String)"]

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.MatchFirstImgSrc(System.String)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.MatchImgTag Method

HtmlToolsMatchImgTag Method
匹配html的img标签

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Match MatchImgTag(
    this string html
)

Parameters

html
Type: SystemString

[Missing <param name="html"/> documentation for "M:Masuit.Tools.Html.HtmlTools.MatchImgTag(System.String)"]

Return Value

Type: Match

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.MatchImgTag(System.String)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.MatchRandomImgSrc Method

HtmlToolsMatchRandomImgSrc Method
随机获取html代码中的img标签的src属性

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string MatchRandomImgSrc(
    this string html
)

Parameters

html
Type: SystemString

[Missing <param name="html"/> documentation for "M:Masuit.Tools.Html.HtmlTools.MatchRandomImgSrc(System.String)"]

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.MatchRandomImgSrc(System.String)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.Post_Http Method

HtmlToolsPost_Http Method
6.2以POST方式抓取远程页面内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Post_Http(
    string url,
    string postData,
    string encodeType
)

Parameters

url
Type: SystemString
URL
postData
Type: SystemString
参数列表
encodeType
Type: SystemString
编码类型

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.Post_Http(System.String,System.String,System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.RemoveByReg Method

HtmlToolsRemoveByReg Method
根据标签进行移除

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string RemoveByReg(
    string sContent,
    string sRegex
)

Parameters

sContent
Type: SystemString
html
sRegex
Type: SystemString
正则表达式

Return Value

Type: String
清理后的代码
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.RemoveEndWith Method

HtmlToolsRemoveEndWith Method
按结尾移除内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string RemoveEndWith(
    string sOrg,
    string sEnd
)

Parameters

sOrg
Type: SystemString
原始数据
sEnd
Type: SystemString
结束的字符串

Return Value

Type: String
清理后的内容
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.RemoveHTML Method

HtmlToolsRemoveHTML Method
3.1清除HTML标记

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string RemoveHTML(
    string Htmlstring
)

Parameters

Htmlstring
Type: SystemString
包括HTML的源码

Return Value

Type: String
已经去除后的文字
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.RemoveHtmlTag Method

HtmlToolsRemoveHtmlTag Method
去除html标签后并截取字符串

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string RemoveHtmlTag(
    this string html,
    int length = 0
)

Parameters

html
Type: SystemString
源html
length (Optional)
Type: SystemInt32
截取长度

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.RemoveHtmlTag(System.String,System.Int32)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.RemoveUnsafeHtml Method

HtmlToolsRemoveUnsafeHtml Method
8.2过滤HTML中的不安全标签，去掉尖括号

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string RemoveUnsafeHtml(
    string content
)

Parameters

content
Type: SystemString
html代码

Return Value

Type: String
过滤后的安全内容
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.Replace Method

HtmlToolsReplace Method
Overload List
Name | Description
Replace(String, String, String, Int32) | 替换指定内容
Replace(String, String, String, String) | 替换指定内容
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.Replace Method (String, String, String, Int32)

HtmlToolsReplace Method (String, String, String, Int32)
替换指定内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Replace(
    string sInput,
    string sRegex,
    string sReplace,
    int iGroupIndex
)

Parameters

sInput
Type: SystemString
输入内容
sRegex
Type: SystemString
表达式字符串
sReplace
Type: SystemString
替换值
iGroupIndex
Type: SystemInt32
分组序号, 0代表不分组

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.Replace(System.String,System.String,System.String,System.Int32)"]

See Also

Reference

HtmlTools Class
Replace Overload
Masuit.Tools.Html Namespace


HtmlTools.Replace Method (String, String, String, String)

HtmlToolsReplace Method (String, String, String, String)
替换指定内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Replace(
    string sInput,
    string sRegex,
    string sReplace,
    string sGroupName
)

Parameters

sInput
Type: SystemString
输入内容
sRegex
Type: SystemString
表达式字符串
sReplace
Type: SystemString
替换值
sGroupName
Type: SystemString
分组名, "" 代表不分组

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.Replace(System.String,System.String,System.String,System.String)"]

See Also

Reference

HtmlTools Class
Replace Overload
Masuit.Tools.Html Namespace


HtmlTools.ReplaceByReg Method

HtmlToolsReplaceByReg Method
根据正则表达式替换内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ReplaceByReg(
    string sContent,
    string sReplace,
    string sRegex
)

Parameters

sContent
Type: SystemString
html
sReplace
Type: SystemString
需要替换的内容
sRegex
Type: SystemString
符合正则的内容

Return Value

Type: String
替换后内容
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.ReplaceHtmlImgSource Method

HtmlToolsReplaceHtmlImgSource Method
替换html的img路径为绝对路径

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ReplaceHtmlImgSource(
    this string html,
    string imgDest
)

Parameters

html
Type: SystemString

[Missing <param name="html"/> documentation for "M:Masuit.Tools.Html.HtmlTools.ReplaceHtmlImgSource(System.String,System.String)"]

imgDest
Type: SystemString

[Missing <param name="imgDest"/> documentation for "M:Masuit.Tools.Html.HtmlTools.ReplaceHtmlImgSource(System.String,System.String)"]

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.ReplaceHtmlImgSource(System.String,System.String)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.ReplaceStrToScript Method

HtmlToolsReplaceStrToScript Method

Note: This API is now obsolete.

为脚本替换特殊字符串

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
[ObsoleteAttribute("不建议使用", true)]
public static string ReplaceStrToScript(
    string str
)

Parameters

str
Type: SystemString

[Missing <param name="str"/> documentation for "M:Masuit.Tools.Html.HtmlTools.ReplaceStrToScript(System.String)"]

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.ReplaceStrToScript(System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.Split Method

HtmlToolsSplit Method
分割指定内容

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static List<string> Split(
    string sInput,
    string sRegex,
    int iStrLen
)

Parameters

sInput
Type: SystemString
输入内容
sRegex
Type: SystemString
表达式字符串
iStrLen
Type: SystemInt32
最小保留字符串长度

Return Value

Type: List String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.Split(System.String,System.String,System.Int32)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.StrFormat Method

HtmlToolsStrFormat Method
替换回车换行符为html换行符

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string StrFormat(
    string str
)

Parameters

str
Type: SystemString
html

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.StrFormat(System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.StringToHtml Method

HtmlToolsStringToHtml Method
字符串转换为 HtmlStringToHtml(string str)

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string StringToHtml(
    string str
)

Parameters

str
Type: SystemString
字符串

Return Value

Type: String
html标签
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.ZipHtml Method

HtmlToolsZipHtml Method
7.1压缩HTML输出

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ZipHtml(
    string Html
)

Parameters

Html
Type: SystemString
html

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Html.HtmlTools.ZipHtml(System.String)"]

See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools Properties

HtmlTools Properties

The HtmlTools type exposes the following members.

Properties
Name | Description
CookieContainer | Cookie容器
Encoding | 获取网页源码时使用的编码
MaxTry | 最大尝试次数
NetworkDelay | 网络延迟
Top
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.CookieContainer Property

HtmlToolsCookieContainer Property
Cookie容器

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static CookieContainer CookieContainer { get; }

Property Value

Type: CookieContainer
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.Encoding Property

HtmlToolsEncoding Property
获取网页源码时使用的编码

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Encoding Encoding { get; set; }

Property Value

Type: Encoding
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.MaxTry Property

HtmlToolsMaxTry Property
最大尝试次数

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int MaxTry { get; set; }

Property Value

Type: Int32
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.NetworkDelay Property

HtmlToolsNetworkDelay Property
网络延迟

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int NetworkDelay { get; set; }

Property Value

Type: Int32
See Also

Reference

HtmlTools Class
Masuit.Tools.Html Namespace


HtmlTools.PageType Enumeration

HtmlToolsPageType Enumeration
页面类型枚举

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public enum PageType
Members
Member name | Value | Description
HTML | 0 | HTML格式
RSS | 1 | RSS格式
See Also

Reference

Masuit.Tools.Html Namespace


ListBuilder Class

ListBuilder Class
无序列表生成器
使用方式：
ListBuilder lb1=new ListBuilder("ul");
lb1.SetTemplate("<a href="{#url}" target="_blank"><strong>{#sortName}</strong> </a>\r\n{#lb2}");
ListBuilder lb2 = new ListBuilder("ul");
lb2.SetTemplate("<a href=url?tid={#id}" target=\"_blank\">{#title}</a> <span class='date'>[{#date}]</span>");
lb2.BindData(dt2);
或者
lb1.AddTemplateData("sortName", dr["sortName"].ToString());
lb1.AddTemplateData("url",url+"#sid."+dr["id"].ToString()+"/page.1/");
lb1.AddTemplateData("lb2",lb2.ToString());
lb1.EndTemplateData();
lSitemap.Text=lb1.ToString();
Inheritance Hierarchy
SystemObject
Masuit.Tools.HtmlListBuilder

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class ListBuilder

The ListBuilder type exposes the following members.

Constructors
 | Name | Description
Public method | ListBuilder | 以ul构造列表
Public method | ListBuilder(String) | 构造函数
Public method | ListBuilder(String, String) | 构造函数
Top
Methods
 | Name | Description
Public method | AddItem | 添加一项
Public method | AddTemplateData | 添加模版数据
Public method | BindData | 根据模板绑定一个dataTable，使用datatable中的值来填充模板
Public method | EndTemplateData | 模版数据添加完成后需调用此方法
Public method | EndTemplateData(String) | 模版数据添加完成后需调用此方法
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Protected method | GenerateString | 生成字符串返回
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MatchEvaluator | 正则匹配中的委托定义
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | SetTemplate | 设置模版
Public method | SetTitle(String) | 设置纯文本标题
Public method | SetTitle(String, String) | 设置标题
Public method | SetTitle(String, String, String) | 设置标题
Public method | SetTitle(String, String, String, String) | 设置标题
Public method | ToString | 返回列表的HTML (Overrides ObjectToString.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

Masuit.Tools.Html Namespace


ListBuilder Constructor

ListBuilder Constructor
Overload List
 | Name | Description
Public method | ListBuilder | 以ul构造列表
Public method | ListBuilder(String) | 构造函数
Public method | ListBuilder(String, String) | 构造函数
Top
See Also

Reference

ListBuilder Class
Masuit.Tools.Html Namespace


ListBuilder Constructor

ListBuilder Constructor
以ul构造列表

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public ListBuilder()
See Also

Reference

ListBuilder Class
ListBuilder Overload
Masuit.Tools.Html Namespace


ListBuilder Constructor (String)

ListBuilder Constructor (String)
构造函数

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public ListBuilder(
    string _type
)

Parameters

_type
Type: SystemString
列表类型，可选"ul","dl"，默认"ul"
See Also

Reference

ListBuilder Class
ListBuilder Overload
Masuit.Tools.Html Namespace


ListBuilder Constructor (String, String)

ListBuilder Constructor (String, String)
构造函数

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public ListBuilder(
    string _type,
    string className
)

Parameters

_type
Type: SystemString
列表类型，可选"ul","dl"，默认"ul"
className
Type: SystemString
类名
See Also

Reference

ListBuilder Class
ListBuilder Overload
Masuit.Tools.Html Namespace


ListBuilder Methods

ListBuilder Methods

The ListBuilder type exposes the following members.

Methods
 | Name | Description
Public method | AddItem | 添加一项
Public method | AddTemplateData | 添加模版数据
Public method | BindData | 根据模板绑定一个dataTable，使用datatable中的值来填充模板
Public method | EndTemplateData | 模版数据添加完成后需调用此方法
Public method | EndTemplateData(String) | 模版数据添加完成后需调用此方法
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Protected method | GenerateString | 生成字符串返回
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MatchEvaluator | 正则匹配中的委托定义
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | SetTemplate | 设置模版
Public method | SetTitle(String) | 设置纯文本标题
Public method | SetTitle(String, String) | 设置标题
Public method | SetTitle(String, String, String) | 设置标题
Public method | SetTitle(String, String, String, String) | 设置标题
Public method | ToString | 返回列表的HTML (Overrides ObjectToString.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

ListBuilder Class
Masuit.Tools.Html Namespace


ListBuilder.AddItem Method

ListBuilderAddItem Method
添加一项

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void AddItem(
    string text,
    string url,
    string target,
    string className
)

Parameters

text
Type: SystemString
文本
url
Type: SystemString
链接
target
Type: SystemString
目标窗口，可选"_blank","_self"等，默认"_self"
className
Type: SystemString
CSS类名
See Also

Reference

ListBuilder Class
Masuit.Tools.Html Namespace


ListBuilder.AddTemplateData Method

ListBuilderAddTemplateData Method
添加模版数据

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void AddTemplateData(
    string name,
    string value
)

Parameters

name
Type: SystemString
名称
value
Type: SystemString
值
See Also

Reference

ListBuilder Class
Masuit.Tools.Html Namespace


ListBuilder.BindData Method

ListBuilderBindData Method
根据模板绑定一个dataTable，使用datatable中的值来填充模板

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void BindData(
    DataTable dataTable
)

Parameters

dataTable
Type: System.DataDataTable
内存表对象
See Also

Reference

ListBuilder Class
Masuit.Tools.Html Namespace


ListBuilder.EndTemplateData Method

ListBuilderEndTemplateData Method
Overload List
 | Name | Description
Public method | EndTemplateData | 模版数据添加完成后需调用此方法
Public method | EndTemplateData(String) | 模版数据添加完成后需调用此方法
Top
See Also

Reference

ListBuilder Class
Masuit.Tools.Html Namespace


ListBuilder.EndTemplateData Method

ListBuilderEndTemplateData Method
模版数据添加完成后需调用此方法

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void EndTemplateData()
See Also

Reference

ListBuilder Class
EndTemplateData Overload
Masuit.Tools.Html Namespace


ListBuilder.EndTemplateData Method (String)

ListBuilderEndTemplateData Method (String)
模版数据添加完成后需调用此方法

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void EndTemplateData(
    string className
)

Parameters

className
Type: SystemString
列表项（li或者dd）的css类名
See Also

Reference

ListBuilder Class
EndTemplateData Overload
Masuit.Tools.Html Namespace


ListBuilder.GenerateString Method

ListBuilderGenerateString Method
生成字符串返回

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
protected string GenerateString()

Return Value

Type: String
生成后的内容
See Also

Reference

ListBuilder Class
Masuit.Tools.Html Namespace


ListBuilder.MatchEvaluator Method

ListBuilderMatchEvaluator Method
正则匹配中的委托定义

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
protected string MatchEvaluator(
    Match m
)

Parameters

m
Type: System.Text.RegularExpressionsMatch
匹配对象

Return Value

Type: String
正则匹配中的委托定义
See Also

Reference

ListBuilder Class
Masuit.Tools.Html Namespace


ListBuilder.SetTemplate Method

ListBuilderSetTemplate Method
设置模版

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void SetTemplate(
    string _template
)

Parameters

_template
Type: SystemString
模版，以{#name}作为参数，name来自数据源datatable或者执行设置
See Also

Reference

ListBuilder Class
Masuit.Tools.Html Namespace


ListBuilder.SetTitle Method

ListBuilderSetTitle Method
Overload List
 | Name | Description
Public method | SetTitle(String) | 设置纯文本标题
Public method | SetTitle(String, String) | 设置标题
Public method | SetTitle(String, String, String) | 设置标题
Public method | SetTitle(String, String, String, String) | 设置标题
Top
See Also

Reference

ListBuilder Class
Masuit.Tools.Html Namespace


ListBuilder.SetTitle Method (String)

ListBuilderSetTitle Method (String)
设置纯文本标题

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void SetTitle(
    string text
)

Parameters

text
Type: SystemString
文本
See Also

Reference

ListBuilder Class
SetTitle Overload
Masuit.Tools.Html Namespace


ListBuilder.SetTitle Method (String, String)

ListBuilderSetTitle Method (String, String)
设置标题

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void SetTitle(
    string text,
    string url
)

Parameters

text
Type: SystemString
文本
url
Type: SystemString
链接
See Also

Reference

ListBuilder Class
SetTitle Overload
Masuit.Tools.Html Namespace


ListBuilder.SetTitle Method (String, String, String)

ListBuilderSetTitle Method (String, String, String)
设置标题

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void SetTitle(
    string text,
    string url,
    string target
)

Parameters

text
Type: SystemString
文本
url
Type: SystemString
链接
target
Type: SystemString
目标窗口，可选"_blank","_self"等，默认"_self"
See Also

Reference

ListBuilder Class
SetTitle Overload
Masuit.Tools.Html Namespace


ListBuilder.SetTitle Method (String, String, String, String)

ListBuilderSetTitle Method (String, String, String, String)
设置标题

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void SetTitle(
    string text,
    string url,
    string target,
    string className
)

Parameters

text
Type: SystemString
文本
url
Type: SystemString
链接
target
Type: SystemString
目标窗口，可选"_blank","_self"等，默认"_self"
className
Type: SystemString
CSS类名
See Also

Reference

ListBuilder Class
SetTitle Overload
Masuit.Tools.Html Namespace


ListBuilder.ToString Method

ListBuilderToString Method
返回列表的HTML

Namespace: Masuit.Tools.Html
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public override string ToString()

Return Value

Type: String
列表的HTML
See Also

Reference

ListBuilder Class
Masuit.Tools.Html Namespace


Masuit.Tools.Media Namespace

Masuit.Tools.Media Namespace

[Missing <summary> documentation for "N:Masuit.Tools.Media"]

Classes
 | Class | Description
Public class | ImageUtilities | 图片处理


ImageUtilities Class

ImageUtilities Class
图片处理
Inheritance Hierarchy
SystemObject
Masuit.Tools.MediaImageUtilities

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class ImageUtilities

The ImageUtilities type exposes the following members.

Methods
Name | Description
BWPic | 转换为黑白图片
Compress | 压缩到指定尺寸
CutAndResize | 裁剪并缩放
CutForCustom | 指定长宽裁剪 按模版比例最大范围的裁剪图片并缩放至模版尺寸
CutForSquare | 正方型裁剪 以图片中心为轴心，截取正方型，然后等比缩放 用于头像处理
CutImage | 裁剪图片 -- 用GDI+
FilPic | 滤色处理
GetFrames | 获取图片中的各帧
GetPicThumbnail | 无损压缩图片
Gray | 图片灰度化
ImageWatermark | 图片水印处理方法
IsWebImage | 判断文件类型是否为WEB格式图片 (注：JPG,GIF,BMP,PNG)
LDPic | 调整光暗
LetterWatermark | 文字水印处理方法
MakeThumbnail | 生成缩略图
Relief | 浮雕处理
RePic | 反色处理
ResizeImage | Resize图片
ResizeImageAsync | 拉伸图片
RevPicLR | 左右翻转
RevPicUD | 上下翻转
ZoomAuto | 图片等比缩放
Top
See Also

Reference

Masuit.Tools.Media Namespace


ImageUtilities Methods

ImageUtilities Methods

The ImageUtilities type exposes the following members.

Methods
Name | Description
BWPic | 转换为黑白图片
Compress | 压缩到指定尺寸
CutAndResize | 裁剪并缩放
CutForCustom | 指定长宽裁剪 按模版比例最大范围的裁剪图片并缩放至模版尺寸
CutForSquare | 正方型裁剪 以图片中心为轴心，截取正方型，然后等比缩放 用于头像处理
CutImage | 裁剪图片 -- 用GDI+
FilPic | 滤色处理
GetFrames | 获取图片中的各帧
GetPicThumbnail | 无损压缩图片
Gray | 图片灰度化
ImageWatermark | 图片水印处理方法
IsWebImage | 判断文件类型是否为WEB格式图片 (注：JPG,GIF,BMP,PNG)
LDPic | 调整光暗
LetterWatermark | 文字水印处理方法
MakeThumbnail | 生成缩略图
Relief | 浮雕处理
RePic | 反色处理
ResizeImage | Resize图片
ResizeImageAsync | 拉伸图片
RevPicLR | 左右翻转
RevPicUD | 上下翻转
ZoomAuto | 图片等比缩放
Top
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.BWPic Method

ImageUtilitiesBWPic Method
转换为黑白图片

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Bitmap BWPic(
    this Bitmap mybm,
    int width,
    int height
)

Parameters

mybm
Type: System.DrawingBitmap
要进行处理的图片
width
Type: SystemInt32
图片的长度
height
Type: SystemInt32
图片的高度

Return Value

Type: Bitmap

[Missing <returns> documentation for "M:Masuit.Tools.Media.ImageUtilities.BWPic(System.Drawing.Bitmap,System.Int32,System.Int32)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.Compress Method

ImageUtilitiesCompress Method
压缩到指定尺寸

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool Compress(
    string oldfile,
    string newfile
)

Parameters

oldfile
Type: SystemString
原文件
newfile
Type: SystemString
新文件

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Masuit.Tools.Media.ImageUtilities.Compress(System.String,System.String)"]

See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.CutAndResize Method

ImageUtilitiesCutAndResize Method
裁剪并缩放

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Bitmap CutAndResize(
    this Bitmap bmp,
    Rectangle rec,
    int newWidth,
    int newHeight
)

Parameters

bmp
Type: System.DrawingBitmap
原始图片
rec
Type: System.DrawingRectangle
裁剪的矩形区域
newWidth
Type: SystemInt32
新的宽度
newHeight
Type: SystemInt32
新的高度

Return Value

Type: Bitmap
处理以后的图片

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.CutForCustom Method

ImageUtilitiesCutForCustom Method
指定长宽裁剪 按模版比例最大范围的裁剪图片并缩放至模版尺寸

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void CutForCustom(
    this Stream fromFile,
    string fileSaveUrl,
    int maxWidth,
    int maxHeight,
    int quality
)

Parameters

fromFile
Type: System.IOStream
原图Stream对象
fileSaveUrl
Type: SystemString
保存路径
maxWidth
Type: SystemInt32
最大宽(单位:px)
maxHeight
Type: SystemInt32
最大高(单位:px)
quality
Type: SystemInt32
质量（范围0-100）

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Stream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.CutForSquare Method

ImageUtilitiesCutForSquare Method
正方型裁剪 以图片中心为轴心，截取正方型，然后等比缩放 用于头像处理

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void CutForSquare(
    this Stream fromFile,
    string fileSaveUrl,
    int side,
    int quality
)

Parameters

fromFile
Type: System.IOStream
原图Stream对象
fileSaveUrl
Type: SystemString
缩略图存放地址
side
Type: SystemInt32
指定的边长（正方型）
quality
Type: SystemInt32
质量（范围0-100）

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Stream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.CutImage Method

ImageUtilitiesCutImage Method
裁剪图片 -- 用GDI+

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Bitmap CutImage(
    this Bitmap b,
    Rectangle rec
)

Parameters

b
Type: System.DrawingBitmap
原始Bitmap
rec
Type: System.DrawingRectangle
裁剪区域

Return Value

Type: Bitmap
剪裁后的Bitmap

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.FilPic Method

ImageUtilitiesFilPic Method
滤色处理

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Bitmap FilPic(
    this Bitmap mybm,
    int width,
    int height
)

Parameters

mybm
Type: System.DrawingBitmap
原始图片
width
Type: SystemInt32
原始图片的长度
height
Type: SystemInt32
原始图片的高度

Return Value

Type: Bitmap

[Missing <returns> documentation for "M:Masuit.Tools.Media.ImageUtilities.FilPic(System.Drawing.Bitmap,System.Int32,System.Int32)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.GetFrames Method

ImageUtilitiesGetFrames Method
获取图片中的各帧

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void GetFrames(
    string pPath,
    string pSavedPath
)

Parameters

pPath
Type: SystemString
图片路径
pSavedPath
Type: SystemString
保存路径
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.GetPicThumbnail Method

ImageUtilitiesGetPicThumbnail Method
无损压缩图片

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool GetPicThumbnail(
    string sFile,
    string dFile,
    int dHeight,
    int dWidth,
    int flag = 100
)

Parameters

sFile
Type: SystemString
原图片
dFile
Type: SystemString
压缩后保存位置
dHeight
Type: SystemInt32
高度
dWidth
Type: SystemInt32
宽度
flag (Optional)
Type: SystemInt32
压缩质量 1-100

Return Value

Type: Boolean
处理结果
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.Gray Method

ImageUtilitiesGray Method
图片灰度化

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Color Gray(
    Color c
)

Parameters

c
Type: System.DrawingColor
输入颜色

Return Value

Type: Color
输出颜色
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.ImageWatermark Method

ImageUtilitiesImageWatermark Method
图片水印处理方法

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ImageWatermark(
    string path,
    string waterpath,
    string location
)

Parameters

path
Type: SystemString
需要加载水印的图片路径（绝对路径）
waterpath
Type: SystemString
水印图片（绝对路径）
location
Type: SystemString
水印位置（传送正确的代码）

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Media.ImageUtilities.ImageWatermark(System.String,System.String,System.String)"]

See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.IsWebImage Method

ImageUtilitiesIsWebImage Method
判断文件类型是否为WEB格式图片 (注：JPG,GIF,BMP,PNG)

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool IsWebImage(
    string contentType
)

Parameters

contentType
Type: SystemString
HttpPostedFile.ContentType

Return Value

Type: Boolean
是否为WEB格式图片
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.LDPic Method

ImageUtilitiesLDPic Method
调整光暗

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Bitmap LDPic(
    this Bitmap mybm,
    int width,
    int height,
    int val
)

Parameters

mybm
Type: System.DrawingBitmap
原始图片
width
Type: SystemInt32
原始图片的长度
height
Type: SystemInt32
原始图片的高度
val
Type: SystemInt32
增加或减少的光暗值

Return Value

Type: Bitmap

[Missing <returns> documentation for "M:Masuit.Tools.Media.ImageUtilities.LDPic(System.Drawing.Bitmap,System.Int32,System.Int32,System.Int32)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.LetterWatermark Method

ImageUtilitiesLetterWatermark Method
文字水印处理方法

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string LetterWatermark(
    string path,
    int size,
    string letter,
    Color color,
    string location
)

Parameters

path
Type: SystemString
图片路径（绝对路径）
size
Type: SystemInt32
字体大小
letter
Type: SystemString
水印文字
color
Type: System.DrawingColor
颜色
location
Type: SystemString
水印位置

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Media.ImageUtilities.LetterWatermark(System.String,System.Int32,System.String,System.Drawing.Color,System.String)"]

See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.MakeThumbnail Method

ImageUtilitiesMakeThumbnail Method
生成缩略图

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void MakeThumbnail(
    string originalImagePath,
    string thumbnailPath,
    int width,
    int height,
    string mode
)

Parameters

originalImagePath
Type: SystemString
源图路径（物理路径）
thumbnailPath
Type: SystemString
缩略图路径（物理路径）
width
Type: SystemInt32
缩略图宽度
height
Type: SystemInt32
缩略图高度
mode
Type: SystemString
生成缩略图的方式
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.Relief Method

ImageUtilitiesRelief Method
浮雕处理

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Bitmap Relief(
    this Bitmap oldBitmap,
    int Width,
    int Height
)

Parameters

oldBitmap
Type: System.DrawingBitmap
原始图片
Width
Type: SystemInt32
原始图片的长度
Height
Type: SystemInt32
原始图片的高度

Return Value

Type: Bitmap

[Missing <returns> documentation for "M:Masuit.Tools.Media.ImageUtilities.Relief(System.Drawing.Bitmap,System.Int32,System.Int32)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.RePic Method

ImageUtilitiesRePic Method
反色处理

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Bitmap RePic(
    this Bitmap mybm,
    int width,
    int height
)

Parameters

mybm
Type: System.DrawingBitmap
原始图片
width
Type: SystemInt32
原始图片的长度
height
Type: SystemInt32
原始图片的高度

Return Value

Type: Bitmap

[Missing <returns> documentation for "M:Masuit.Tools.Media.ImageUtilities.RePic(System.Drawing.Bitmap,System.Int32,System.Int32)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.ResizeImage Method

ImageUtilitiesResizeImage Method
Resize图片

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Bitmap ResizeImage(
    this Bitmap bmp,
    int newWidth,
    int newHeight
)

Parameters

bmp
Type: System.DrawingBitmap
原始Bitmap
newWidth
Type: SystemInt32
新的宽度
newHeight
Type: SystemInt32
新的高度

Return Value

Type: Bitmap
处理以后的图片

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.ResizeImageAsync Method

ImageUtilitiesResizeImageAsync Method
拉伸图片

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Task<Bitmap> ResizeImageAsync(
    this Bitmap bmp,
    int newW,
    int newH
)

Parameters

bmp
Type: System.DrawingBitmap
原始图片
newW
Type: SystemInt32
新的宽度
newH
Type: SystemInt32
新的高度

Return Value

Type: Task Bitmap

[Missing <returns> documentation for "M:Masuit.Tools.Media.ImageUtilities.ResizeImageAsync(System.Drawing.Bitmap,System.Int32,System.Int32)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.RevPicLR Method

ImageUtilitiesRevPicLR Method
左右翻转

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Bitmap RevPicLR(
    this Bitmap mybm,
    int width,
    int height
)

Parameters

mybm
Type: System.DrawingBitmap
原始图片
width
Type: SystemInt32
原始图片的长度
height
Type: SystemInt32
原始图片的高度

Return Value

Type: Bitmap

[Missing <returns> documentation for "M:Masuit.Tools.Media.ImageUtilities.RevPicLR(System.Drawing.Bitmap,System.Int32,System.Int32)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.RevPicUD Method

ImageUtilitiesRevPicUD Method
上下翻转

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Bitmap RevPicUD(
    this Bitmap mybm,
    int width,
    int height
)

Parameters

mybm
Type: System.DrawingBitmap
原始图片
width
Type: SystemInt32
原始图片的长度
height
Type: SystemInt32
原始图片的高度

Return Value

Type: Bitmap

[Missing <returns> documentation for "M:Masuit.Tools.Media.ImageUtilities.RevPicUD(System.Drawing.Bitmap,System.Int32,System.Int32)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


ImageUtilities.ZoomAuto Method

ImageUtilitiesZoomAuto Method
图片等比缩放

Namespace: Masuit.Tools.Media
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void ZoomAuto(
    this Stream fromFile,
    string savePath,
    double targetWidth,
    double targetHeight,
    string watermarkText,
    string watermarkImage
)

Parameters

fromFile
Type: System.IOStream
原图Stream对象
savePath
Type: SystemString
缩略图存放地址
targetWidth
Type: SystemDouble
指定的最大宽度
targetHeight
Type: SystemDouble
指定的最大高度
watermarkText
Type: SystemString
水印文字(为""表示不使用水印)
watermarkImage
Type: SystemString
水印图片路径(为""表示不使用水印)

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Stream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ImageUtilities Class
Masuit.Tools.Media Namespace


Masuit.Tools.Models Namespace

Masuit.Tools.Models Namespace

[Missing <summary> documentation for "N:Masuit.Tools.Models"]

Classes
 | Class | Description
Public class | Email |
Public class | INetAddress |
Public class | IPData |


Email Class

Email Class

[Missing <summary> documentation for "T:Masuit.Tools.Models.Email"]

Inheritance Hierarchy
SystemObject
Masuit.Tools.ModelsEmail

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class Email

The Email type exposes the following members.

Constructors
 | Name | Description
Public method | Email | Initializes a new instance of the Email class
Top
Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | SendAsync | 使用异步发送邮件
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Properties
 | Name | Description
Public property | Body | 邮件正文
Public property | EnableSsl | 是否启用SSL
Public property | Password | 发件人邮箱密码
Public property | SmtpPort | 发送服务器端口号，默认25
Public property | SmtpServer | 发送服务器地址
Public property | Subject | 邮件标题
Public property | Tos | 收件人，多个收件人用英文逗号隔开
Public property | Username | 发件人用户名
Top
See Also

Reference

Masuit.Tools.Models Namespace


Email Constructor

Email Constructor
Initializes a new instance of the Email class

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Email()
See Also

Reference

Email Class
Masuit.Tools.Models Namespace


Email Methods

Email Methods

The Email type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | SendAsync | 使用异步发送邮件
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

Email Class
Masuit.Tools.Models Namespace


Email.SendAsync Method

EmailSendAsync Method
使用异步发送邮件

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void SendAsync(
    Action<string> completedCallback
)

Parameters

completedCallback
Type: SystemAction String
邮件发送后的回调方法

Return Value

Type:
See Also

Reference

Email Class
Masuit.Tools.Models Namespace


Email Properties

Email Properties

The Email type exposes the following members.

Properties
 | Name | Description
Public property | Body | 邮件正文
Public property | EnableSsl | 是否启用SSL
Public property | Password | 发件人邮箱密码
Public property | SmtpPort | 发送服务器端口号，默认25
Public property | SmtpServer | 发送服务器地址
Public property | Subject | 邮件标题
Public property | Tos | 收件人，多个收件人用英文逗号隔开
Public property | Username | 发件人用户名
Top
See Also

Reference

Email Class
Masuit.Tools.Models Namespace


Email.Body Property

EmailBody Property
邮件正文

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Body { get; set; }

Property Value

Type: String
See Also

Reference

Email Class
Masuit.Tools.Models Namespace


Email.EnableSsl Property

EmailEnableSsl Property
是否启用SSL

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool EnableSsl { get; set; }

Property Value

Type: Boolean
See Also

Reference

Email Class
Masuit.Tools.Models Namespace


Email.Password Property

EmailPassword Property
发件人邮箱密码

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Password { get; set; }

Property Value

Type: String
See Also

Reference

Email Class
Masuit.Tools.Models Namespace


Email.SmtpPort Property

EmailSmtpPort Property
发送服务器端口号，默认25

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public int SmtpPort { get; set; }

Property Value

Type: Int32
See Also

Reference

Email Class
Masuit.Tools.Models Namespace


Email.SmtpServer Property

EmailSmtpServer Property
发送服务器地址

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string SmtpServer { get; set; }

Property Value

Type: String
See Also

Reference

Email Class
Masuit.Tools.Models Namespace


Email.Subject Property

EmailSubject Property
邮件标题

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Subject { get; set; }

Property Value

Type: String
See Also

Reference

Email Class
Masuit.Tools.Models Namespace


Email.Tos Property

EmailTos Property
收件人，多个收件人用英文逗号隔开

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Tos { get; set; }

Property Value

Type: String
See Also

Reference

Email Class
Masuit.Tools.Models Namespace


Email.Username Property

EmailUsername Property
发件人用户名

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Username { get; set; }

Property Value

Type: String
See Also

Reference

Email Class
Masuit.Tools.Models Namespace


INetAddress Class

INetAddress Class

[Missing <summary> documentation for "T:Masuit.Tools.Models.INetAddress"]

Inheritance Hierarchy
SystemObject
Masuit.Tools.ModelsINetAddress

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class INetAddress

The INetAddress type exposes the following members.

Constructors
 | Name | Description
Public method | INetAddress | Initializes a new instance of the INetAddress class
Top
Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Properties
 | Name | Description
Public property | code |
Public property | data |
Top
See Also

Reference

Masuit.Tools.Models Namespace


INetAddress Constructor

INetAddress Constructor
Initializes a new instance of the INetAddress class

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public INetAddress()
See Also

Reference

INetAddress Class
Masuit.Tools.Models Namespace


INetAddress Methods

INetAddress Methods

The INetAddress type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

INetAddress Class
Masuit.Tools.Models Namespace


INetAddress Properties

INetAddress Properties

The INetAddress type exposes the following members.

Properties
 | Name | Description
Public property | code |
Public property | data |
Top
See Also

Reference

INetAddress Class
Masuit.Tools.Models Namespace


INetAddress.code Property

INetAddresscode Property

[Missing <summary> documentation for "P:Masuit.Tools.Models.INetAddress.code"]

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public int code { get; set; }

Property Value

Type: Int32
See Also

Reference

INetAddress Class
Masuit.Tools.Models Namespace


INetAddress.data Property

INetAddressdata Property

[Missing <summary> documentation for "P:Masuit.Tools.Models.INetAddress.data"]

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public IPData data { get; set; }

Property Value

Type: IPData
See Also

Reference

INetAddress Class
Masuit.Tools.Models Namespace


IPData Class

IPData Class

[Missing <summary> documentation for "T:Masuit.Tools.Models.IPData"]

Inheritance Hierarchy
SystemObject
Masuit.Tools.ModelsIPData

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class IPData

The IPData type exposes the following members.

Constructors
 | Name | Description
Public method | IPData | Initializes a new instance of the IPData class
Top
Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Properties
 | Name | Description
Public property | area | 地区
Public property | area_id | 地区id
Public property | city | 市
Public property | city_id | 市id
Public property | country | 国家
Public property | country_id | 国家id
Public property | county | 区
Public property | county_id | 区id
Public property | ip | ip地址
Public property | isp | 网络供应商
Public property | isp_id | 网络供应商id
Public property | region | 省份
Public property | region_id | 省份id
Top
See Also

Reference

Masuit.Tools.Models Namespace


IPData Constructor

IPData Constructor
Initializes a new instance of the IPData class

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public IPData()
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData Methods

IPData Methods

The IPData type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData Properties

IPData Properties

The IPData type exposes the following members.

Properties
 | Name | Description
Public property | area | 地区
Public property | area_id | 地区id
Public property | city | 市
Public property | city_id | 市id
Public property | country | 国家
Public property | country_id | 国家id
Public property | county | 区
Public property | county_id | 区id
Public property | ip | ip地址
Public property | isp | 网络供应商
Public property | isp_id | 网络供应商id
Public property | region | 省份
Public property | region_id | 省份id
Top
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.area Property

IPDataarea Property
地区

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string area { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.area_id Property

IPDataarea_id Property
地区id

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string area_id { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.city Property

IPDatacity Property
市

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string city { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.city_id Property

IPDatacity_id Property
市id

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string city_id { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.country Property

IPDatacountry Property
国家

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string country { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.country_id Property

IPDatacountry_id Property
国家id

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string country_id { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.county Property

IPDatacounty Property
区

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string county { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.county_id Property

IPDatacounty_id Property
区id

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string county_id { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.ip Property

IPDataip Property
ip地址

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string ip { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.isp Property

IPDataisp Property
网络供应商

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string isp { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.isp_id Property

IPDataisp_id Property
网络供应商id

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string isp_id { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.region Property

IPDataregion Property
省份

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string region { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


IPData.region_id Property

IPDataregion_id Property
省份id

Namespace: Masuit.Tools.Models
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string region_id { get; set; }

Property Value

Type: String
See Also

Reference

IPData Class
Masuit.Tools.Models Namespace


Masuit.Tools.Net Namespace

Masuit.Tools.Net Namespace

[Missing <summary> documentation for "N:Masuit.Tools.Net"]

Classes
 | Class | Description
Public class | CacheHelper | 全局统一的缓存类
Public class | CookieHelper | Cookie操作辅助类
Public class | CookieItem | Cookie对象
Public class | SocketClient | Socket客户端操作类
Public class | WebExtension | Web操作扩展


CacheHelper Class

CacheHelper Class
全局统一的缓存类
Inheritance Hierarchy
SystemObject
Masuit.Tools.NetCacheHelper

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class CacheHelper

The CacheHelper type exposes the following members.

Methods
Name | Description
Add | 添加缓存数据
GetCacheT | 获取数据缓存
RemoveAllCache | 移除全部缓存
RemoveAllCache(String) | 移除指定数据缓存
SetCache(String, Object) | 设置数据缓存
SetCache(String, Object, TimeSpan) | 设置数据缓存
SetCache(String, Object, DateTime, TimeSpan) | 设置当前应用程序指定CacheKey的Cache值
Top
Properties
Name | Description
Instance | 缓存实例
Top
See Also

Reference

Masuit.Tools.Net Namespace


CacheHelper Methods

CacheHelper Methods

The CacheHelper type exposes the following members.

Methods
Name | Description
Add | 添加缓存数据
GetCacheT | 获取数据缓存
RemoveAllCache | 移除全部缓存
RemoveAllCache(String) | 移除指定数据缓存
SetCache(String, Object) | 设置数据缓存
SetCache(String, Object, TimeSpan) | 设置数据缓存
SetCache(String, Object, DateTime, TimeSpan) | 设置当前应用程序指定CacheKey的Cache值
Top
See Also

Reference

CacheHelper Class
Masuit.Tools.Net Namespace


CacheHelper.Add Method

CacheHelperAdd Method
添加缓存数据

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void Add(
    string key,
    Object value
)

Parameters

key
Type: SystemString
键
value
Type: SystemObject
值
See Also

Reference

CacheHelper Class
Masuit.Tools.Net Namespace


CacheHelper.GetCache(T) Method

CacheHelperGetCacheT Method
获取数据缓存

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T GetCache<T>(
    string CacheKey
)

Parameters

CacheKey
Type: SystemString
键

Type Parameters

T
返回的类型

Return Value

Type: T

[Missing <returns> documentation for "M:Masuit.Tools.Net.CacheHelper.GetCache``1(System.String)"]

See Also

Reference

CacheHelper Class
Masuit.Tools.Net Namespace


CacheHelper.RemoveAllCache Method

CacheHelperRemoveAllCache Method
Overload List
Name | Description
RemoveAllCache | 移除全部缓存
RemoveAllCache(String) | 移除指定数据缓存
Top
See Also

Reference

CacheHelper Class
Masuit.Tools.Net Namespace


CacheHelper.RemoveAllCache Method

CacheHelperRemoveAllCache Method
移除全部缓存

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void RemoveAllCache()
See Also

Reference

CacheHelper Class
RemoveAllCache Overload
Masuit.Tools.Net Namespace


CacheHelper.RemoveAllCache Method (String)

CacheHelperRemoveAllCache Method (String)
移除指定数据缓存

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void RemoveAllCache(
    string CacheKey
)

Parameters

CacheKey
Type: SystemString
键
See Also

Reference

CacheHelper Class
RemoveAllCache Overload
Masuit.Tools.Net Namespace


CacheHelper.SetCache Method

CacheHelperSetCache Method
Overload List
Name | Description
SetCache(String, Object) | 设置数据缓存
SetCache(String, Object, TimeSpan) | 设置数据缓存
SetCache(String, Object, DateTime, TimeSpan) | 设置当前应用程序指定CacheKey的Cache值
Top
See Also

Reference

CacheHelper Class
Masuit.Tools.Net Namespace


CacheHelper.SetCache Method (String, Object)

CacheHelperSetCache Method (String, Object)
设置数据缓存

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetCache(
    string CacheKey,
    Object objObject
)

Parameters

CacheKey
Type: SystemString
键
objObject
Type: SystemObject
值
See Also

Reference

CacheHelper Class
SetCache Overload
Masuit.Tools.Net Namespace


CacheHelper.SetCache Method (String, Object, TimeSpan)

CacheHelperSetCache Method (String, Object, TimeSpan)
设置数据缓存

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetCache(
    string cacheKey,
    Object objObject,
    TimeSpan Timeout
)

Parameters

cacheKey
Type: SystemString
键
objObject
Type: SystemObject
值
Timeout
Type: SystemTimeSpan
过期时间
Exceptions
Exception | Condition
ArgumentNullException | cacheKey"/> is null.
See Also

Reference

CacheHelper Class
SetCache Overload
Masuit.Tools.Net Namespace


CacheHelper.SetCache Method (String, Object, DateTime, TimeSpan)

CacheHelperSetCache Method (String, Object, DateTime, TimeSpan)
设置当前应用程序指定CacheKey的Cache值

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetCache(
    string CacheKey,
    Object objObject,
    DateTime absoluteExpiration,
    TimeSpan slidingExpiration
)

Parameters

CacheKey
Type: SystemString
键
objObject
Type: SystemObject
值
absoluteExpiration
Type: SystemDateTime
绝对过期时间
slidingExpiration
Type: SystemTimeSpan
滑动过期时间
See Also

Reference

CacheHelper Class
SetCache Overload
Masuit.Tools.Net Namespace


CacheHelper Properties

CacheHelper Properties

The CacheHelper type exposes the following members.

Properties
Name | Description
Instance | 缓存实例
Top
See Also

Reference

CacheHelper Class
Masuit.Tools.Net Namespace


CacheHelper.Instance Property

CacheHelperInstance Property
缓存实例

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Cache Instance { get; }

Property Value

Type: Cache
See Also

Reference

CacheHelper Class
Masuit.Tools.Net Namespace


CookieHelper Class

CookieHelper Class
Cookie操作辅助类
Inheritance Hierarchy
SystemObject
Masuit.Tools.NetCookieHelper

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class CookieHelper

The CookieHelper type exposes the following members.

Methods
Name | Description
Clear | 删除所有cookie值
ClearCookie | 清除指定Cookie
ClearCookies | 清除系统指定的Cookie
ClearCookiesFiles | 清除系统的Cookie文件
CookieFormat | 格式化Cookie为标准格式
GetCK(CookieCollection) | 从CookieCollection中获取Cookie字符串
GetCK(String) | 从Cookie数组中转换成不重复的Cookie字符串，相同的Cookie取前面的
GetCK(String, String) | 将Cookie字符串填充到CookieCollection中
GetCKS | 获取cookie数组
GetCookieList | 根据字符生成Cookie列表
GetCookieValue(String) | 获取指定Cookie值
GetCookieValue(String, String) | 根据Key值得到Cookie值,Key不区分大小写
GetDomains | 获取所有可能的Cookie域
GetUriCookieContainer | 获取Cookie容器
IncludeCKAsync | 检查Cookie集合中是否包含指定的Cookie值
InternetSetCookie | 设置系统Cookie
PrintCookies | 获取url下的Cookie
SetCKAppendToCC | 将Cookie字符串描述的Cookie追加到CookieCoollection
SetCKToSystem(CookieCollection, String) | 将CookieCollection中的Cookie设置到系统中，便于浏览器使用
SetCKToSystem(String, String) | 将Cookie字符串设置到系统中，便于浏览器使用
SetCookie(String, String) | 添加一个Cookie（24小时过期）
SetCookie(String, String, DateTime) | 添加一个Cookie
Top
See Also

Reference

Masuit.Tools.Net Namespace


CookieHelper Methods

CookieHelper Methods

The CookieHelper type exposes the following members.

Methods
Name | Description
Clear | 删除所有cookie值
ClearCookie | 清除指定Cookie
ClearCookies | 清除系统指定的Cookie
ClearCookiesFiles | 清除系统的Cookie文件
CookieFormat | 格式化Cookie为标准格式
GetCK(CookieCollection) | 从CookieCollection中获取Cookie字符串
GetCK(String) | 从Cookie数组中转换成不重复的Cookie字符串，相同的Cookie取前面的
GetCK(String, String) | 将Cookie字符串填充到CookieCollection中
GetCKS | 获取cookie数组
GetCookieList | 根据字符生成Cookie列表
GetCookieValue(String) | 获取指定Cookie值
GetCookieValue(String, String) | 根据Key值得到Cookie值,Key不区分大小写
GetDomains | 获取所有可能的Cookie域
GetUriCookieContainer | 获取Cookie容器
IncludeCKAsync | 检查Cookie集合中是否包含指定的Cookie值
InternetSetCookie | 设置系统Cookie
PrintCookies | 获取url下的Cookie
SetCKAppendToCC | 将Cookie字符串描述的Cookie追加到CookieCoollection
SetCKToSystem(CookieCollection, String) | 将CookieCollection中的Cookie设置到系统中，便于浏览器使用
SetCKToSystem(String, String) | 将Cookie字符串设置到系统中，便于浏览器使用
SetCookie(String, String) | 添加一个Cookie（24小时过期）
SetCookie(String, String, DateTime) | 添加一个Cookie
Top
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.Clear Method

CookieHelperClear Method
删除所有cookie值

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void Clear()
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.ClearCookie Method

CookieHelperClearCookie Method
清除指定Cookie

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void ClearCookie(
    string cookiename
)

Parameters

cookiename
Type: SystemString
cookiename
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.ClearCookies Method

CookieHelperClearCookies Method
清除系统指定的Cookie

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void ClearCookies(
    string ck,
    string url
)

Parameters

ck
Type: SystemString
指定的Cookie
url
Type: SystemString
Cookie的域
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.ClearCookiesFiles Method

CookieHelperClearCookiesFiles Method
清除系统的Cookie文件

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void ClearCookiesFiles()
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.CookieFormat Method

CookieHelperCookieFormat Method
格式化Cookie为标准格式

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string CookieFormat(
    string key,
    string value
)

Parameters

key
Type: SystemString
Key值
value
Type: SystemString
Value值

Return Value

Type: String
格式化后的数据
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.GetCK Method

CookieHelperGetCK Method
Overload List
Name | Description
GetCK(CookieCollection) | 从CookieCollection中获取Cookie字符串
GetCK(String) | 从Cookie数组中转换成不重复的Cookie字符串，相同的Cookie取前面的
GetCK(String, String) | 将Cookie字符串填充到CookieCollection中
Top
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.GetCK Method (CookieCollection)

CookieHelperGetCK Method (CookieCollection)
从CookieCollection中获取Cookie字符串

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetCK(
    this CookieCollection cc
)

Parameters

cc
Type: System.NetCookieCollection
CookieCollection，一般用在WebRequest中

Return Value

Type: String
转换后的Cookie字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type CookieCollection. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

CookieHelper Class
GetCK Overload
Masuit.Tools.Net Namespace


CookieHelper.GetCK Method (String[])

CookieHelperGetCK Method (String)
从Cookie数组中转换成不重复的Cookie字符串，相同的Cookie取前面的

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetCK(
    string[] cks
)

Parameters

cks
Type: SystemString
Cookie数组

Return Value

Type: String
剔除重复的Cookie字符串
See Also

Reference

CookieHelper Class
GetCK Overload
Masuit.Tools.Net Namespace


CookieHelper.GetCK Method (String, String)

CookieHelperGetCK Method (String, String)
将Cookie字符串填充到CookieCollection中

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static CookieCollection GetCK(
    string ck,
    string url
)

Parameters

ck
Type: SystemString
Cookie字符串
url
Type: SystemString
Cookie的域

Return Value

Type: CookieCollection
添加后的CookieCollection
See Also

Reference

CookieHelper Class
GetCK Overload
Masuit.Tools.Net Namespace


CookieHelper.GetCKS Method

CookieHelperGetCKS Method
获取cookie数组

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string[] GetCKS(
    string ck
)

Parameters

ck
Type: SystemString
cokki数据

Return Value

Type: String
字符串数组
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.GetCookieList Method

CookieHelperGetCookieList Method
根据字符生成Cookie列表

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static List<CookieItem> GetCookieList(
    string cookie
)

Parameters

cookie
Type: SystemString
Cookie字符串

Return Value

Type: List CookieItem
Cookie列表
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.GetCookieValue Method

CookieHelperGetCookieValue Method
Overload List
Name | Description
GetCookieValue(String) | 获取指定Cookie值
GetCookieValue(String, String) | 根据Key值得到Cookie值,Key不区分大小写
Top
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.GetCookieValue Method (String)

CookieHelperGetCookieValue Method (String)
获取指定Cookie值

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetCookieValue(
    string cookiename
)

Parameters

cookiename
Type: SystemString
cookiename

Return Value

Type: String
Cookie值
See Also

Reference

CookieHelper Class
GetCookieValue Overload
Masuit.Tools.Net Namespace


CookieHelper.GetCookieValue Method (String, String)

CookieHelperGetCookieValue Method (String, String)
根据Key值得到Cookie值,Key不区分大小写

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetCookieValue(
    string Key,
    string cookie
)

Parameters

Key
Type: SystemString
key
cookie
Type: SystemString
字符串Cookie

Return Value

Type: String
Cookie值
See Also

Reference

CookieHelper Class
GetCookieValue Overload
Masuit.Tools.Net Namespace


CookieHelper.GetDomains Method

CookieHelperGetDomains Method
获取所有可能的Cookie域

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static List<string> GetDomains(
    string url
)

Parameters

url
Type: SystemString
域的全称

Return Value

Type: List String
所有可能的域
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.GetUriCookieContainer Method

CookieHelperGetUriCookieContainer Method
获取Cookie容器

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static CookieContainer GetUriCookieContainer(
    this Uri uri
)

Parameters

uri
Type: SystemUri
URL

Return Value

Type: CookieContainer
Cookie容器

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Uri. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.IncludeCKAsync Method

CookieHelperIncludeCKAsync Method
检查Cookie集合中是否包含指定的Cookie值

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Task<bool> IncludeCKAsync(
    this List<string> cks,
    string ck
)

Parameters

cks
Type: System.Collections.GenericList String
Cookie集合
ck
Type: SystemString
待判断的Cookie

Return Value

Type: Task Boolean
Cookie集合中是否包含指定的Cookie

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type List String . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.InternetSetCookie Method

CookieHelperInternetSetCookie Method
设置系统Cookie

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool InternetSetCookie(
    string lpszUrlName,
    string lbszCookieName,
    string lpszCookieData
)

Parameters

lpszUrlName
Type: SystemString
Cookie域
lbszCookieName
Type: SystemString
Cookie名
lpszCookieData
Type: SystemString
Cookie数据

Return Value

Type: Boolean
设置成功与否
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.PrintCookies Method

CookieHelperPrintCookies Method
获取url下的Cookie

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string PrintCookies(
    this CookieContainer cookies,
    Uri uri
)

Parameters

cookies
Type: System.NetCookieContainer
Cookie对象
uri
Type: SystemUri
URL

Return Value

Type: String
Cookie内容

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type CookieContainer. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.SetCKAppendToCC Method

CookieHelperSetCKAppendToCC Method
将Cookie字符串描述的Cookie追加到CookieCoollection

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetCKAppendToCC(
    this CookieCollection cc,
    string ck,
    string url
)

Parameters

cc
Type: System.NetCookieCollection
CookieCoollection
ck
Type: SystemString
Cookie字符串
url
Type: SystemString
Cookie的域

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type CookieCollection. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.SetCKToSystem Method

CookieHelperSetCKToSystem Method
Overload List
Name | Description
SetCKToSystem(CookieCollection, String) | 将CookieCollection中的Cookie设置到系统中，便于浏览器使用
SetCKToSystem(String, String) | 将Cookie字符串设置到系统中，便于浏览器使用
Top
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.SetCKToSystem Method (CookieCollection, String)

CookieHelperSetCKToSystem Method (CookieCollection, String)
将CookieCollection中的Cookie设置到系统中，便于浏览器使用

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetCKToSystem(
    this CookieCollection cc,
    string url
)

Parameters

cc
Type: System.NetCookieCollection
CookieCollection
url
Type: SystemString
Cookie的域

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type CookieCollection. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

CookieHelper Class
SetCKToSystem Overload
Masuit.Tools.Net Namespace


CookieHelper.SetCKToSystem Method (String, String)

CookieHelperSetCKToSystem Method (String, String)
将Cookie字符串设置到系统中，便于浏览器使用

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetCKToSystem(
    string ck,
    string url
)

Parameters

ck
Type: SystemString
Cookie字符串
url
Type: SystemString
Cookie的域
See Also

Reference

CookieHelper Class
SetCKToSystem Overload
Masuit.Tools.Net Namespace


CookieHelper.SetCookie Method

CookieHelperSetCookie Method
Overload List
Name | Description
SetCookie(String, String) | 添加一个Cookie（24小时过期）
SetCookie(String, String, DateTime) | 添加一个Cookie
Top
See Also

Reference

CookieHelper Class
Masuit.Tools.Net Namespace


CookieHelper.SetCookie Method (String, String)

CookieHelperSetCookie Method (String, String)
添加一个Cookie（24小时过期）

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetCookie(
    string cookiename,
    string cookievalue
)

Parameters

cookiename
Type: SystemString
键
cookievalue
Type: SystemString
值
See Also

Reference

CookieHelper Class
SetCookie Overload
Masuit.Tools.Net Namespace


CookieHelper.SetCookie Method (String, String, DateTime)

CookieHelperSetCookie Method (String, String, DateTime)
添加一个Cookie

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetCookie(
    string cookiename,
    string cookievalue,
    DateTime expires
)

Parameters

cookiename
Type: SystemString
cookie名
cookievalue
Type: SystemString
cookie值
expires
Type: SystemDateTime
过期时间 DateTime
See Also

Reference

CookieHelper Class
SetCookie Overload
Masuit.Tools.Net Namespace


CookieItem Class

CookieItem Class
Cookie对象
Inheritance Hierarchy
SystemObject
Masuit.Tools.NetCookieItem

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class CookieItem

The CookieItem type exposes the following members.

Constructors
 | Name | Description
Public method | CookieItem | Initializes a new instance of the CookieItem class
Top
Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Properties
 | Name | Description
Public property | Key | 键
Public property | Value | 值
Top
See Also

Reference

Masuit.Tools.Net Namespace


CookieItem Constructor

CookieItem Constructor
Initializes a new instance of the CookieItem class

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public CookieItem()
See Also

Reference

CookieItem Class
Masuit.Tools.Net Namespace


CookieItem Methods

CookieItem Methods

The CookieItem type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

CookieItem Class
Masuit.Tools.Net Namespace


CookieItem Properties

CookieItem Properties

The CookieItem type exposes the following members.

Properties
 | Name | Description
Public property | Key | 键
Public property | Value | 值
Top
See Also

Reference

CookieItem Class
Masuit.Tools.Net Namespace


CookieItem.Key Property

CookieItemKey Property
键

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Key { get; set; }

Property Value

Type: String
See Also

Reference

CookieItem Class
Masuit.Tools.Net Namespace


CookieItem.Value Property

CookieItemValue Property
值

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string Value { get; set; }

Property Value

Type: String
See Also

Reference

CookieItem Class
Masuit.Tools.Net Namespace


SocketClient Class

SocketClient Class
Socket客户端操作类
Inheritance Hierarchy
SystemObject
Masuit.Tools.NetSocketClient

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class SocketClient

The SocketClient type exposes the following members.

Methods
Name | Description
ConnectSocket(TcpClient, IPEndPoint) | 从客户端连接获取socket对象
ConnectSocket(TcpClient, IPAddress, Int32) | 从客户端连接获取socket对象
ConnectStream(TcpClient, IPEndPoint) | 从客户端获取网络流对象
ConnectStream(TcpClient, IPAddress, Int32) | 从客户端获取网络流对象
GetPath | 得到文件路径(防止有文件名重复) 如:aaa.txt已经在directory目录下存在,则会得到文件aaa(1).txt
ListenerSocket | 服务器侦听方法 返回null则说明没有链接上
ListenerStream | 服务器侦听方法 返回null则说明没有链接上
ReceiveFile(Socket, String) | 预先不知道文件名和文件大小 用此方法接收 此方法对于的发送方法是SendFile()
ReceiveFile(Socket, String, String, Int64) | 从socket服务端接收文件
ReceiveFile(Socket, String, String, Int64, ActionInt32) | 在预先得到文件的文件名和大小 调用此方法接收文件
ReceiveFixData | 接受固定长度字符串
ReceiveVarData(Socket) | 接收变长字符串 为了处理粘包问题 ,每次发送数据时 包头(数据字节长度) + 正文 这个发送小数据 设置包头的字节为8,不能超过8位数的字节数组
ReceiveVarDataT(Socket) | 接收T类对象,反序列化
SendFile(Socket, String) | 发送文件,不需要进度信息和(头)信息
SendFile(Socket, String, Boolean) | 发送文件,不需要进度信息
SendFile(Socket, String, Boolean, ActionInt32) | 发送文件
SendFixData | 发送固定长度消息 发送字节数不能大于int型最大值
SendSerializeObjectT | 发送T类型对象,序列化
SendVarData(Socket, Byte) | 发送变成信息
SendVarData(Socket, String) | 发送变长信息 格式 包头(包头占8位) + 正文
Top
See Also

Reference

Masuit.Tools.Net Namespace


SocketClient Methods

SocketClient Methods

The SocketClient type exposes the following members.

Methods
Name | Description
ConnectSocket(TcpClient, IPEndPoint) | 从客户端连接获取socket对象
ConnectSocket(TcpClient, IPAddress, Int32) | 从客户端连接获取socket对象
ConnectStream(TcpClient, IPEndPoint) | 从客户端获取网络流对象
ConnectStream(TcpClient, IPAddress, Int32) | 从客户端获取网络流对象
GetPath | 得到文件路径(防止有文件名重复) 如:aaa.txt已经在directory目录下存在,则会得到文件aaa(1).txt
ListenerSocket | 服务器侦听方法 返回null则说明没有链接上
ListenerStream | 服务器侦听方法 返回null则说明没有链接上
ReceiveFile(Socket, String) | 预先不知道文件名和文件大小 用此方法接收 此方法对于的发送方法是SendFile()
ReceiveFile(Socket, String, String, Int64) | 从socket服务端接收文件
ReceiveFile(Socket, String, String, Int64, ActionInt32) | 在预先得到文件的文件名和大小 调用此方法接收文件
ReceiveFixData | 接受固定长度字符串
ReceiveVarData(Socket) | 接收变长字符串 为了处理粘包问题 ,每次发送数据时 包头(数据字节长度) + 正文 这个发送小数据 设置包头的字节为8,不能超过8位数的字节数组
ReceiveVarDataT(Socket) | 接收T类对象,反序列化
SendFile(Socket, String) | 发送文件,不需要进度信息和(头)信息
SendFile(Socket, String, Boolean) | 发送文件,不需要进度信息
SendFile(Socket, String, Boolean, ActionInt32) | 发送文件
SendFixData | 发送固定长度消息 发送字节数不能大于int型最大值
SendSerializeObjectT | 发送T类型对象,序列化
SendVarData(Socket, Byte) | 发送变成信息
SendVarData(Socket, String) | 发送变长信息 格式 包头(包头占8位) + 正文
Top
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.ConnectSocket Method

SocketClientConnectSocket Method
Overload List
Name | Description
ConnectSocket(TcpClient, IPEndPoint) | 从客户端连接获取socket对象
ConnectSocket(TcpClient, IPAddress, Int32) | 从客户端连接获取socket对象
Top
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.ConnectSocket Method (TcpClient, IPEndPoint)

SocketClientConnectSocket Method (TcpClient, IPEndPoint)
从客户端连接获取socket对象

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Socket ConnectSocket(
    this TcpClient tcpclient,
    IPEndPoint ipendpoint
)

Parameters

tcpclient
Type: System.Net.SocketsTcpClient
TCP客户端
ipendpoint
Type: System.NetIPEndPoint
客户端节点

Return Value

Type: Socket
客户端socket

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TcpClient. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
ConnectSocket Overload
Masuit.Tools.Net Namespace


SocketClient.ConnectSocket Method (TcpClient, IPAddress, Int32)

SocketClientConnectSocket Method (TcpClient, IPAddress, Int32)
从客户端连接获取socket对象

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Socket ConnectSocket(
    this TcpClient tcpclient,
    IPAddress ipadd,
    int port
)

Parameters

tcpclient
Type: System.Net.SocketsTcpClient
TCP客户端
ipadd
Type: System.NetIPAddress
IP地址
port
Type: SystemInt32
端口号

Return Value

Type: Socket
客户端socket

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TcpClient. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
ConnectSocket Overload
Masuit.Tools.Net Namespace


SocketClient.ConnectStream Method

SocketClientConnectStream Method
Overload List
Name | Description
ConnectStream(TcpClient, IPEndPoint) | 从客户端获取网络流对象
ConnectStream(TcpClient, IPAddress, Int32) | 从客户端获取网络流对象
Top
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.ConnectStream Method (TcpClient, IPEndPoint)

SocketClientConnectStream Method (TcpClient, IPEndPoint)
从客户端获取网络流对象

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static NetworkStream ConnectStream(
    this TcpClient tcpclient,
    IPEndPoint ipendpoint
)

Parameters

tcpclient
Type: System.Net.SocketsTcpClient
TCP客户端
ipendpoint
Type: System.NetIPEndPoint
客户端节点

Return Value

Type: NetworkStream
客户端的网络流

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TcpClient. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
ConnectStream Overload
Masuit.Tools.Net Namespace


SocketClient.ConnectStream Method (TcpClient, IPAddress, Int32)

SocketClientConnectStream Method (TcpClient, IPAddress, Int32)
从客户端获取网络流对象

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static NetworkStream ConnectStream(
    this TcpClient tcpclient,
    IPAddress ipadd,
    int port
)

Parameters

tcpclient
Type: System.Net.SocketsTcpClient
TCP客户端
ipadd
Type: System.NetIPAddress
IP地址
port
Type: SystemInt32
端口号

Return Value

Type: NetworkStream
客户端网络流对象

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TcpClient. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
ConnectStream Overload
Masuit.Tools.Net Namespace


SocketClient.GetPath Method

SocketClientGetPath Method
得到文件路径(防止有文件名重复) 如:aaa.txt已经在directory目录下存在,则会得到文件aaa(1).txt

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetPath(
    string directory,
    string file
)

Parameters

directory
Type: SystemString
目录名
file
Type: SystemString
文件名

Return Value

Type: String
文件路径
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.ListenerSocket Method

SocketClientListenerSocket Method
服务器侦听方法 返回null则说明没有链接上

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Socket ListenerSocket(
    this TcpListener listener
)

Parameters

listener
Type: System.Net.SocketsTcpListener

[Missing <param name="listener"/> documentation for "M:Masuit.Tools.Net.SocketClient.ListenerSocket(System.Net.Sockets.TcpListener)"]

Return Value

Type: Socket
返回一个套接字(Socket)

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TcpListener. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.ListenerStream Method

SocketClientListenerStream Method
服务器侦听方法 返回null则说明没有链接上

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static NetworkStream ListenerStream(
    this TcpListener listener
)

Parameters

listener
Type: System.Net.SocketsTcpListener
TCP监听对象

Return Value

Type: NetworkStream
返回一个网络流

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TcpListener. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.ReceiveFile Method

SocketClientReceiveFile Method
Overload List
Name | Description
ReceiveFile(Socket, String) | 预先不知道文件名和文件大小 用此方法接收 此方法对于的发送方法是SendFile()
ReceiveFile(Socket, String, String, Int64) | 从socket服务端接收文件
ReceiveFile(Socket, String, String, Int64, ActionInt32) | 在预先得到文件的文件名和大小 调用此方法接收文件
Top
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.ReceiveFile Method (Socket, String)

SocketClientReceiveFile Method (Socket, String)
预先不知道文件名和文件大小 用此方法接收 此方法对于的发送方法是SendFile()

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void ReceiveFile(
    this Socket socket,
    string path
)

Parameters

socket
Type: System.Net.SocketsSocket
socket服务端
path
Type: SystemString
要保存的目录

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
ReceiveFile Overload
Masuit.Tools.Net Namespace


SocketClient.ReceiveFile Method (Socket, String, String, Int64)

SocketClientReceiveFile Method (Socket, String, String, Int64)
从socket服务端接收文件

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool ReceiveFile(
    this Socket socket,
    string path,
    string filename,
    long size
)

Parameters

socket
Type: System.Net.SocketsSocket
socket服务端
path
Type: SystemString
文件保存路径(必须存在)
filename
Type: SystemString
文件名
size
Type: SystemInt64
预先知道的文件大小

Return Value

Type: Boolean
处理结果

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
ReceiveFile Overload
Masuit.Tools.Net Namespace


SocketClient.ReceiveFile Method (Socket, String, String, Int64, Action(Int32))

SocketClientReceiveFile Method (Socket, String, String, Int64, ActionInt32)
在预先得到文件的文件名和大小 调用此方法接收文件

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool ReceiveFile(
    this Socket socket,
    string path,
    string filename,
    long size,
    Action<int> progress
)

Parameters

socket
Type: System.Net.SocketsSocket
socket服务端
path
Type: SystemString
路径必须存在
filename
Type: SystemString
文件名
size
Type: SystemInt64
预先知道的文件大小
progress
Type: SystemAction Int32
处理过程

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Masuit.Tools.Net.SocketClient.ReceiveFile(System.Net.Sockets.Socket,System.String,System.String,System.Int64,System.Action{System.Int32})"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
ReceiveFile Overload
Masuit.Tools.Net Namespace


SocketClient.ReceiveFixData Method

SocketClientReceiveFixData Method
接受固定长度字符串

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static byte[] ReceiveFixData(
    this Socket socket,
    int size
)

Parameters

socket
Type: System.Net.SocketsSocket
socket对象
size
Type: SystemInt32
字符串长度

Return Value

Type: Byte
字节数据

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.ReceiveVarData Method

SocketClientReceiveVarData Method
Overload List
Name | Description
ReceiveVarData(Socket) | 接收变长字符串 为了处理粘包问题 ,每次发送数据时 包头(数据字节长度) + 正文 这个发送小数据 设置包头的字节为8,不能超过8位数的字节数组
ReceiveVarDataT(Socket) | 接收T类对象,反序列化
Top
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.ReceiveVarData Method (Socket)

SocketClientReceiveVarData Method (Socket)
接收变长字符串 为了处理粘包问题 ,每次发送数据时 包头(数据字节长度) + 正文 这个发送小数据 设置包头的字节为8,不能超过8位数的字节数组

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static byte[] ReceiveVarData(
    this Socket socket
)

Parameters

socket
Type: System.Net.SocketsSocket
客户端socket

Return Value

Type: Byte
byte[]数组

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
ReceiveVarData Overload
Masuit.Tools.Net Namespace


SocketClient.ReceiveVarData(T) Method (Socket)

SocketClientReceiveVarDataT Method (Socket)
接收T类对象,反序列化

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T ReceiveVarData<T>(
    this Socket socket
)

Parameters

socket
Type: System.Net.SocketsSocket
客户端socket

Type Parameters

T
接收T类对象,T类必须是一个可序列化类

Return Value

Type: T
强类型对象

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
ReceiveVarData Overload
Masuit.Tools.Net Namespace


SocketClient.SendFile Method

SocketClientSendFile Method
Overload List
Name | Description
SendFile(Socket, String) | 发送文件,不需要进度信息和(头)信息
SendFile(Socket, String, Boolean) | 发送文件,不需要进度信息
SendFile(Socket, String, Boolean, ActionInt32) | 发送文件
Top
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.SendFile Method (Socket, String)

SocketClientSendFile Method (Socket, String)
发送文件,不需要进度信息和(头)信息

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool SendFile(
    this Socket socket,
    string path
)

Parameters

socket
Type: System.Net.SocketsSocket
socket对象
path
Type: SystemString
文件路径

Return Value

Type: Boolean
处理结果

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
SendFile Overload
Masuit.Tools.Net Namespace


SocketClient.SendFile Method (Socket, String, Boolean)

SocketClientSendFile Method (Socket, String, Boolean)
发送文件,不需要进度信息

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool SendFile(
    this Socket socket,
    string path,
    bool issend
)

Parameters

socket
Type: System.Net.SocketsSocket
socket对象
path
Type: SystemString
文件路径
issend
Type: SystemBoolean
是否发生(头)信息

Return Value

Type: Boolean
处理结果

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
SendFile Overload
Masuit.Tools.Net Namespace


SocketClient.SendFile Method (Socket, String, Boolean, Action(Int32))

SocketClientSendFile Method (Socket, String, Boolean, ActionInt32)
发送文件

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool SendFile(
    this Socket socket,
    string path,
    bool issend,
    Action<int> progress
)

Parameters

socket
Type: System.Net.SocketsSocket
socket对象
path
Type: SystemString
文件路径
issend
Type: SystemBoolean
是否发送文件(头)信息,如果当前知道文件[大小,名称]则为false
progress
Type: SystemAction Int32
处理过程

Return Value

Type: Boolean
处理结果

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
SendFile Overload
Masuit.Tools.Net Namespace


SocketClient.SendFixData Method

SocketClientSendFixData Method
发送固定长度消息 发送字节数不能大于int型最大值

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int SendFixData(
    this Socket socket,
    byte[] msg
)

Parameters

socket
Type: System.Net.SocketsSocket
源socket
msg
Type: SystemByte
消息的字节数组

Return Value

Type: Int32
返回发送字节个数

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.SendSerializeObject(T) Method

SocketClientSendSerializeObjectT Method
发送T类型对象,序列化

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int SendSerializeObject<T>(
    this Socket socket,
    T obj
)

Parameters

socket
Type: System.Net.SocketsSocket
发送方的socket对象
obj
Type: T
T类型对象,必须是可序列化的

Type Parameters

T
T类型

Return Value

Type: Int32
消息长度

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.SendVarData Method

SocketClientSendVarData Method
Overload List
Name | Description
SendVarData(Socket, Byte) | 发送变成信息
SendVarData(Socket, String) | 发送变长信息 格式 包头(包头占8位) + 正文
Top
See Also

Reference

SocketClient Class
Masuit.Tools.Net Namespace


SocketClient.SendVarData Method (Socket, Byte[])

SocketClientSendVarData Method (Socket, Byte)
发送变成信息

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int SendVarData(
    this Socket socket,
    byte[] bytes
)

Parameters

socket
Type: System.Net.SocketsSocket
发送方socket对象
bytes
Type: SystemByte
消息的 字节数组

Return Value

Type: Int32
消息长度

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
SendVarData Overload
Masuit.Tools.Net Namespace


SocketClient.SendVarData Method (Socket, String)

SocketClientSendVarData Method (Socket, String)
发送变长信息 格式 包头(包头占8位) + 正文

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int SendVarData(
    this Socket socket,
    string contact
)

Parameters

socket
Type: System.Net.SocketsSocket
发送方socket对象
contact
Type: SystemString
发送文本

Return Value

Type: Int32
发送的数据内容长度

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Socket. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

SocketClient Class
SendVarData Overload
Masuit.Tools.Net Namespace


WebExtension Class

WebExtension Class
Web操作扩展
Inheritance Hierarchy
SystemObject
Masuit.Tools.NetWebExtension

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class WebExtension

The WebExtension type exposes the following members.

Methods
Name | Description
GetDbContextT | 获取线程内唯一的EF上下文对象
GetIPAddressInfoAsync | 获取客户端IP地址信息
GetSessionT | 获取Session
SetSession | 写Session
Top
See Also

Reference

Masuit.Tools.Net Namespace


WebExtension Methods

WebExtension Methods

The WebExtension type exposes the following members.

Methods
Name | Description
GetDbContextT | 获取线程内唯一的EF上下文对象
GetIPAddressInfoAsync | 获取客户端IP地址信息
GetSessionT | 获取Session
SetSession | 写Session
Top
See Also

Reference

WebExtension Class
Masuit.Tools.Net Namespace


WebExtension.GetDbContext(T) Method

WebExtensionGetDbContextT Method
获取线程内唯一的EF上下文对象

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T GetDbContext<T>()
where T : new()

Type Parameters

T
EF上下文容器对象

Return Value

Type: T
EF上下文容器对象
See Also

Reference

WebExtension Class
Masuit.Tools.Net Namespace


WebExtension.GetIPAddressInfoAsync Method

WebExtensionGetIPAddressInfoAsync Method
获取客户端IP地址信息

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Task<IPData> GetIPAddressInfoAsync(
    this string ip
)

Parameters

ip
Type: SystemString
IP地址

Return Value

Type: Task IPData
详细的地理位置、运营商信息

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

WebExtension Class
Masuit.Tools.Net Namespace


WebExtension.GetSession(T) Method

WebExtensionGetSessionT Method
获取Session

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T GetSession<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T
对象

Return Value

Type: T
对象
See Also

Reference

WebExtension Class
Masuit.Tools.Net Namespace


WebExtension.SetSession Method

WebExtensionSetSession Method
写Session

Namespace: Masuit.Tools.Net
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetSession(
    string key,
    Object value
)

Parameters

key
Type: SystemString
键
value
Type: SystemObject
值
See Also

Reference

WebExtension Class
Masuit.Tools.Net Namespace


Masuit.Tools.NoSQL Namespace

Masuit.Tools.NoSQL Namespace

[Missing <summary> documentation for "N:Masuit.Tools.NoSQL"]

Classes
 | Class | Description
Public class | RedisConnectionHelp | ConnectionMultiplexer对象管理帮助类
Public class | RedisHelper | Redis操作


RedisConnectionHelp Class

RedisConnectionHelp Class
ConnectionMultiplexer对象管理帮助类
Inheritance Hierarchy
SystemObject
Masuit.Tools.NoSQLRedisConnectionHelp

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class RedisConnectionHelp

The RedisConnectionHelp type exposes the following members.

Methods
Name | Description
GetConnectionMultiplexer | 缓存获取
Top
Fields
Name | Description
RedisConnectionString | Redis服务器连接字符串，在config配置文件中的ConnectionStrings节下配置，name固定为RedisHosts，值的格式：127.0.0.1:6379,allowadmin=true，如： <connectionStrings> <add name = "RedisHosts" connectionString="127.0.0.1:6379,allowadmin=true"/> </connectionStrings>
SysCustomKey | 系统自定义Key前缀
Top
Properties
Name | Description
Instance | 单例获取
Top
See Also

Reference

Masuit.Tools.NoSQL Namespace


RedisConnectionHelp Fields

RedisConnectionHelp Fields

The RedisConnectionHelp type exposes the following members.

Fields
Name | Description
RedisConnectionString | Redis服务器连接字符串，在config配置文件中的ConnectionStrings节下配置，name固定为RedisHosts，值的格式：127.0.0.1:6379,allowadmin=true，如： <connectionStrings> <add name = "RedisHosts" connectionString="127.0.0.1:6379,allowadmin=true"/> </connectionStrings>
SysCustomKey | 系统自定义Key前缀
Top
See Also

Reference

RedisConnectionHelp Class
Masuit.Tools.NoSQL Namespace


RedisConnectionHelp.RedisConnectionString Field

RedisConnectionHelpRedisConnectionString Field
Redis服务器连接字符串，在config配置文件中的ConnectionStrings节下配置，name固定为RedisHosts，值的格式：127.0.0.1:6379,allowadmin=true，如：
<connectionStrings>
<add name = "RedisHosts" connectionString="127.0.0.1:6379,allowadmin=true"/>
</connectionStrings>

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static readonly string RedisConnectionString

Field Value

Type: String
See Also

Reference

RedisConnectionHelp Class
Masuit.Tools.NoSQL Namespace


RedisConnectionHelp.SysCustomKey Field

RedisConnectionHelpSysCustomKey Field
系统自定义Key前缀

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static readonly string SysCustomKey

Field Value

Type: String
See Also

Reference

RedisConnectionHelp Class
Masuit.Tools.NoSQL Namespace


RedisConnectionHelp Methods

RedisConnectionHelp Methods

The RedisConnectionHelp type exposes the following members.

Methods
Name | Description
GetConnectionMultiplexer | 缓存获取
Top
See Also

Reference

RedisConnectionHelp Class
Masuit.Tools.NoSQL Namespace


RedisConnectionHelp.GetConnectionMultiplexer Method

RedisConnectionHelpGetConnectionMultiplexer Method
缓存获取

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static ConnectionMultiplexer GetConnectionMultiplexer(
    string connectionString
)

Parameters

connectionString
Type: SystemString
连接字符串

Return Value

Type: ConnectionMultiplexer
连接对象
See Also

Reference

RedisConnectionHelp Class
Masuit.Tools.NoSQL Namespace


RedisConnectionHelp Properties

RedisConnectionHelp Properties

The RedisConnectionHelp type exposes the following members.

Properties
Name | Description
Instance | 单例获取
Top
See Also

Reference

RedisConnectionHelp Class
Masuit.Tools.NoSQL Namespace


RedisConnectionHelp.Instance Property

RedisConnectionHelpInstance Property
单例获取

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static ConnectionMultiplexer Instance { get; }

Property Value

Type: ConnectionMultiplexer
See Also

Reference

RedisConnectionHelp Class
Masuit.Tools.NoSQL Namespace


RedisHelper Class

RedisHelper Class
Redis操作
Inheritance Hierarchy
SystemObject
Masuit.Tools.NoSQLRedisHelper

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class RedisHelper

The RedisHelper type exposes the following members.

Constructors
 | Name | Description
Public method | RedisHelper(Int32) | 构造函数，使用该构造函数需要先在config中配置链接字符串，连接字符串在config配置文件中的ConnectionStrings节下配置，name固定为RedisHosts，值的格式：127.0.0.1:6379,allowadmin=true，若未正确配置，将按默认值“127.0.0.1:6379,allowadmin=true”进行操作，如： <connectionStrings> <add name = "RedisHosts" connectionString="127.0.0.1:6379,allowadmin=true"/> </connectionStrings>
Public method | RedisHelper(Int32, String) | 构造函数
Top
Methods
 | Name | Description
Public method | CreateTransaction | 创建一个事务
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetDatabase | 获得一个数据库实例
Public method | GetHashCode | (Inherited from Object.)
Public method | GetServer | 获得一个服务器实例
Public method | GetType | (Inherited from Object.)
Public method | HashDecrement | 为数字减少val
Public method | HashDecrementAsync | 为数字减少val
Public method | HashDelete(String, ListRedisValue) | 移除hash中的多个值
Public method | HashDelete(String, String) | 移除hash中的某值
Public method | HashDeleteAsync(String, ListRedisValue) | 移除hash中的多个值
Public method | HashDeleteAsync(String, String) | 移除hash中的某值
Public method | HashExists | 判断某个数据是否已经被缓存
Public method | HashExistsAsync | 判断某个数据是否已经被缓存
Public method | HashGeAsyncT | 从hash表获取数据
Public method | HashGetT | 从hash表获取数据
Public method | HashIncrement | 为数字增长val
Public method | HashIncrementAsync | 为数字增长val
Public method | HashKeysT | 获取hashkey所有Redis key
Public method | HashKeysAsyncT | 获取hashkey所有Redis key
Public method | HashSetT | 存储数据到hash表
Public method | HashSetAsyncT | 存储数据到hash表
Public method | KeyDelete(ListString) | 删除多个key
Public method | KeyDelete(String) | 删除单个key
Public method | KeyExists | 判断key是否存储
Public method | KeyExpire | 设置Key的时间
Public method | KeyRename | 重新命名key
Public method | ListLeftPopT | 出栈
Public method | ListLeftPopAsyncT | 出栈
Public method | ListLeftPushT | 入栈
Public method | ListLeftPushAsyncT | 入栈
Public method | ListLength | 获取集合中的数量
Public method | ListLengthAsync | 获取集合中的数量
Public method | ListRangeT | 获取指定key的List
Public method | ListRangeAsyncT | 获取指定key的List
Public method | ListRemoveT | 移除指定ListId的内部List的值
Public method | ListRemoveAsyncT | 移除指定ListId的内部List的值
Public method | ListRightPopT | 出队
Public method | ListRightPopAsyncT | 出队
Public method | ListRightPushT | 入队
Public method | ListRightPushAsyncT | 入队
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | PublishT | Redis发布订阅 发布
Public method | SetSysCustomKey | 设置前缀
Public method | SortedSetAddT | 添加
Public method | SortedSetAddAsyncT | 添加
Public method | SortedSetLength | 获取集合中的数量
Public method | SortedSetLengthAsync | 获取集合中的数量
Public method | SortedSetRangeByRankT | 获取全部
Public method | SortedSetRangeByRankAsyncT | 获取全部
Public method | SortedSetRemoveT | 删除
Public method | SortedSetRemoveAsyncT | 删除
Public method | StringDecrement | 为数字减少val
Public method | StringDecrementAsync | 为数字减少val
Public method | StringGet(ListString) | 获取多个Key
Public method | StringGet(String) | 获取单个key的值
Public method | StringGetT(String) | 获取一个key的对象
Public method | StringGetAsync(ListString) | 获取多个Key
Public method | StringGetAsync(String) | 获取单个key的值
Public method | StringGetAsyncT(String) | 获取一个key的对象
Public method | StringIncrement | 为数字增长val
Public method | StringIncrementAsync | 为数字增长val
Public method | StringSet(ListKeyValuePairRedisKey, RedisValue) | 保存多个key value
Public method | StringSet(String, String, NullableTimeSpan) | 保存单个key value
Public method | StringSetT(String, T, NullableTimeSpan) | 保存一个对象
Public method | StringSetAsync(ListKeyValuePairRedisKey, RedisValue) | 保存多个key value
Public method | StringSetAsync(String, String, NullableTimeSpan) | 保存单个key value
Public method | StringSetAsyncT(String, T, NullableTimeSpan) | 保存一个对象
Public method | Subscribe | Redis发布订阅 订阅
Public method | ToString | (Inherited from Object.)
Public method | Unsubscribe | Redis发布订阅 取消订阅
Public method | UnsubscribeAll | Redis发布订阅 取消全部订阅
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Fields
 | Name | Description
Public field | CustomKey | 自定义键
Top
See Also

Reference

Masuit.Tools.NoSQL Namespace


RedisHelper Constructor

RedisHelper Constructor
Overload List
 | Name | Description
Public method | RedisHelper(Int32) | 构造函数，使用该构造函数需要先在config中配置链接字符串，连接字符串在config配置文件中的ConnectionStrings节下配置，name固定为RedisHosts，值的格式：127.0.0.1:6379,allowadmin=true，若未正确配置，将按默认值“127.0.0.1:6379,allowadmin=true”进行操作，如： <connectionStrings> <add name = "RedisHosts" connectionString="127.0.0.1:6379,allowadmin=true"/> </connectionStrings>
Public method | RedisHelper(Int32, String) | 构造函数
Top
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper Constructor (Int32)

RedisHelper Constructor (Int32)
构造函数，使用该构造函数需要先在config中配置链接字符串，连接字符串在config配置文件中的ConnectionStrings节下配置，name固定为RedisHosts，值的格式：127.0.0.1:6379,allowadmin=true，若未正确配置，将按默认值“127.0.0.1:6379,allowadmin=true”进行操作，如：
<connectionStrings>
<add name = "RedisHosts" connectionString="127.0.0.1:6379,allowadmin=true"/>
</connectionStrings>

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public RedisHelper(
    int dbNum = 0
)

Parameters

dbNum (Optional)
Type: SystemInt32
数据库编号
See Also

Reference

RedisHelper Class
RedisHelper Overload
Masuit.Tools.NoSQL Namespace


RedisHelper Constructor (Int32, String)

RedisHelper Constructor (Int32, String)
构造函数

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public RedisHelper(
    int dbNum,
    string readWriteHosts
)

Parameters

dbNum
Type: SystemInt32
数据库的编号
readWriteHosts
Type: SystemString
Redis服务器连接字符串，格式：127.0.0.1:6379,allowadmin=true
See Also

Reference

RedisHelper Class
RedisHelper Overload
Masuit.Tools.NoSQL Namespace


RedisHelper Fields

RedisHelper Fields

The RedisHelper type exposes the following members.

Fields
 | Name | Description
Public field | CustomKey | 自定义键
Top
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.CustomKey Field

RedisHelperCustomKey Field
自定义键

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string CustomKey

Field Value

Type: String
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper Methods

RedisHelper Methods

The RedisHelper type exposes the following members.

Methods
 | Name | Description
Public method | CreateTransaction | 创建一个事务
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetDatabase | 获得一个数据库实例
Public method | GetHashCode | (Inherited from Object.)
Public method | GetServer | 获得一个服务器实例
Public method | GetType | (Inherited from Object.)
Public method | HashDecrement | 为数字减少val
Public method | HashDecrementAsync | 为数字减少val
Public method | HashDelete(String, ListRedisValue) | 移除hash中的多个值
Public method | HashDelete(String, String) | 移除hash中的某值
Public method | HashDeleteAsync(String, ListRedisValue) | 移除hash中的多个值
Public method | HashDeleteAsync(String, String) | 移除hash中的某值
Public method | HashExists | 判断某个数据是否已经被缓存
Public method | HashExistsAsync | 判断某个数据是否已经被缓存
Public method | HashGeAsyncT | 从hash表获取数据
Public method | HashGetT | 从hash表获取数据
Public method | HashIncrement | 为数字增长val
Public method | HashIncrementAsync | 为数字增长val
Public method | HashKeysT | 获取hashkey所有Redis key
Public method | HashKeysAsyncT | 获取hashkey所有Redis key
Public method | HashSetT | 存储数据到hash表
Public method | HashSetAsyncT | 存储数据到hash表
Public method | KeyDelete(ListString) | 删除多个key
Public method | KeyDelete(String) | 删除单个key
Public method | KeyExists | 判断key是否存储
Public method | KeyExpire | 设置Key的时间
Public method | KeyRename | 重新命名key
Public method | ListLeftPopT | 出栈
Public method | ListLeftPopAsyncT | 出栈
Public method | ListLeftPushT | 入栈
Public method | ListLeftPushAsyncT | 入栈
Public method | ListLength | 获取集合中的数量
Public method | ListLengthAsync | 获取集合中的数量
Public method | ListRangeT | 获取指定key的List
Public method | ListRangeAsyncT | 获取指定key的List
Public method | ListRemoveT | 移除指定ListId的内部List的值
Public method | ListRemoveAsyncT | 移除指定ListId的内部List的值
Public method | ListRightPopT | 出队
Public method | ListRightPopAsyncT | 出队
Public method | ListRightPushT | 入队
Public method | ListRightPushAsyncT | 入队
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | PublishT | Redis发布订阅 发布
Public method | SetSysCustomKey | 设置前缀
Public method | SortedSetAddT | 添加
Public method | SortedSetAddAsyncT | 添加
Public method | SortedSetLength | 获取集合中的数量
Public method | SortedSetLengthAsync | 获取集合中的数量
Public method | SortedSetRangeByRankT | 获取全部
Public method | SortedSetRangeByRankAsyncT | 获取全部
Public method | SortedSetRemoveT | 删除
Public method | SortedSetRemoveAsyncT | 删除
Public method | StringDecrement | 为数字减少val
Public method | StringDecrementAsync | 为数字减少val
Public method | StringGet(ListString) | 获取多个Key
Public method | StringGet(String) | 获取单个key的值
Public method | StringGetT(String) | 获取一个key的对象
Public method | StringGetAsync(ListString) | 获取多个Key
Public method | StringGetAsync(String) | 获取单个key的值
Public method | StringGetAsyncT(String) | 获取一个key的对象
Public method | StringIncrement | 为数字增长val
Public method | StringIncrementAsync | 为数字增长val
Public method | StringSet(ListKeyValuePairRedisKey, RedisValue) | 保存多个key value
Public method | StringSet(String, String, NullableTimeSpan) | 保存单个key value
Public method | StringSetT(String, T, NullableTimeSpan) | 保存一个对象
Public method | StringSetAsync(ListKeyValuePairRedisKey, RedisValue) | 保存多个key value
Public method | StringSetAsync(String, String, NullableTimeSpan) | 保存单个key value
Public method | StringSetAsyncT(String, T, NullableTimeSpan) | 保存一个对象
Public method | Subscribe | Redis发布订阅 订阅
Public method | ToString | (Inherited from Object.)
Public method | Unsubscribe | Redis发布订阅 取消订阅
Public method | UnsubscribeAll | Redis发布订阅 取消全部订阅
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.CreateTransaction Method

RedisHelperCreateTransaction Method
创建一个事务

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public ITransaction CreateTransaction()

Return Value

Type: ITransaction
事务对象
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.GetDatabase Method

RedisHelperGetDatabase Method
获得一个数据库实例

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public IDatabase GetDatabase()

Return Value

Type: IDatabase
数据库实例
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.GetServer Method

RedisHelperGetServer Method
获得一个服务器实例

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public IServer GetServer(
    string hostAndPort
)

Parameters

hostAndPort
Type: SystemString
服务器地址

Return Value

Type: IServer
服务器实例
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashDecrement Method

RedisHelperHashDecrement Method
为数字减少val

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double HashDecrement(
    string key,
    string dataKey,
    double val = 1
)

Parameters

key
Type: SystemString
键
dataKey
Type: SystemString
对象的字段
val (Optional)
Type: SystemDouble
可以为负

Return Value

Type: Double
减少后的值
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashDecrementAsync Method

RedisHelperHashDecrementAsync Method
为数字减少val

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<double> HashDecrementAsync(
    string key,
    string dataKey,
    double val = 1
)

Parameters

key
Type: SystemString
键
dataKey
Type: SystemString
对象的字段
val (Optional)
Type: SystemDouble
可以为负

Return Value

Type: Task Double
减少后的值
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashDelete Method

RedisHelperHashDelete Method
Overload List
 | Name | Description
Public method | HashDelete(String, ListRedisValue) | 移除hash中的多个值
Public method | HashDelete(String, String) | 移除hash中的某值
Top
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashDelete Method (String, List(RedisValue))

RedisHelperHashDelete Method (String, ListRedisValue)
移除hash中的多个值

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public long HashDelete(
    string key,
    List<RedisValue> dataKeys
)

Parameters

key
Type: SystemString
键
dataKeys
Type: System.Collections.GenericList RedisValue
对象的字段集合

Return Value

Type: Int64
数量
See Also

Reference

RedisHelper Class
HashDelete Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.HashDelete Method (String, String)

RedisHelperHashDelete Method (String, String)
移除hash中的某值

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool HashDelete(
    string key,
    string dataKey
)

Parameters

key
Type: SystemString
键
dataKey
Type: SystemString
对象的字段

Return Value

Type: Boolean
是否移除成功
See Also

Reference

RedisHelper Class
HashDelete Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.HashDeleteAsync Method

RedisHelperHashDeleteAsync Method
Overload List
 | Name | Description
Public method | HashDeleteAsync(String, ListRedisValue) | 移除hash中的多个值
Public method | HashDeleteAsync(String, String) | 移除hash中的某值
Top
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashDeleteAsync Method (String, List(RedisValue))

RedisHelperHashDeleteAsync Method (String, ListRedisValue)
移除hash中的多个值

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<long> HashDeleteAsync(
    string key,
    List<RedisValue> dataKeys
)

Parameters

key
Type: SystemString
键
dataKeys
Type: System.Collections.GenericList RedisValue
对象的字段集合

Return Value

Type: Task Int64
数量
See Also

Reference

RedisHelper Class
HashDeleteAsync Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.HashDeleteAsync Method (String, String)

RedisHelperHashDeleteAsync Method (String, String)
移除hash中的某值

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<bool> HashDeleteAsync(
    string key,
    string dataKey
)

Parameters

key
Type: SystemString
键
dataKey
Type: SystemString
对象的字段

Return Value

Type: Task Boolean
是否移除成功
See Also

Reference

RedisHelper Class
HashDeleteAsync Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.HashExists Method

RedisHelperHashExists Method
判断某个数据是否已经被缓存

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool HashExists(
    string key,
    string dataKey
)

Parameters

key
Type: SystemString
键
dataKey
Type: SystemString
对象的字段

Return Value

Type: Boolean
是否缓存成功
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashExistsAsync Method

RedisHelperHashExistsAsync Method
判断某个数据是否已经被缓存

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<bool> HashExistsAsync(
    string key,
    string dataKey
)

Parameters

key
Type: SystemString
键
dataKey
Type: SystemString
对象的字段

Return Value

Type: Task Boolean
是否缓存成功
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashGeAsync(T) Method

RedisHelperHashGeAsyncT Method
从hash表获取数据

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<T> HashGeAsync<T>(
    string key,
    string dataKey
)

Parameters

key
Type: SystemString
键
dataKey
Type: SystemString
对象的字段

Type Parameters

T
数据类型

Return Value

Type: Task T
对象实例
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashGet(T) Method

RedisHelperHashGetT Method
从hash表获取数据

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public T HashGet<T>(
    string key,
    string dataKey
)

Parameters

key
Type: SystemString
键
dataKey
Type: SystemString
对象的字段

Type Parameters

T
数据类型

Return Value

Type: T
对象实例
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashIncrement Method

RedisHelperHashIncrement Method
为数字增长val

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double HashIncrement(
    string key,
    string dataKey,
    double val = 1
)

Parameters

key
Type: SystemString
键
dataKey
Type: SystemString
对象的字段
val (Optional)
Type: SystemDouble
可以为负

Return Value

Type: Double
增长后的值
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashIncrementAsync Method

RedisHelperHashIncrementAsync Method
为数字增长val

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<double> HashIncrementAsync(
    string key,
    string dataKey,
    double val = 1
)

Parameters

key
Type: SystemString
键
dataKey
Type: SystemString
对象的字段
val (Optional)
Type: SystemDouble
可以为负

Return Value

Type: Task Double
增长后的值
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashKeys(T) Method

RedisHelperHashKeysT Method
获取hashkey所有Redis key

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public List<T> HashKeys<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T
数据类型

Return Value

Type: List T
数据集合
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashKeysAsync(T) Method

RedisHelperHashKeysAsyncT Method
获取hashkey所有Redis key

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<List<T>> HashKeysAsync<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T
数据类型

Return Value

Type: Task List T
数据集合
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashSet(T) Method

RedisHelperHashSetT Method
存储数据到hash表

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool HashSet<T>(
    string key,
    string dataKey,
    T t
)

Parameters

key
Type: SystemString
键
dataKey
Type: SystemString
对象的字段
t
Type: T
对象实例

Type Parameters

T
数据类型

Return Value

Type: Boolean
是否存储成功
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.HashSetAsync(T) Method

RedisHelperHashSetAsyncT Method
存储数据到hash表

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<bool> HashSetAsync<T>(
    string key,
    string dataKey,
    T t
)

Parameters

key
Type: SystemString
键
dataKey
Type: SystemString
对象的字段
t
Type: T
对象实例

Type Parameters

T
数据类型

Return Value

Type: Task Boolean
是否存储成功
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.KeyDelete Method

RedisHelperKeyDelete Method
Overload List
 | Name | Description
Public method | KeyDelete(ListString) | 删除多个key
Public method | KeyDelete(String) | 删除单个key
Top
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.KeyDelete Method (List(String))

RedisHelperKeyDelete Method (ListString)
删除多个key

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public long KeyDelete(
    List<string> keys
)

Parameters

keys
Type: System.Collections.GenericList String
rediskey

Return Value

Type: Int64
成功删除的个数
See Also

Reference

RedisHelper Class
KeyDelete Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.KeyDelete Method (String)

RedisHelperKeyDelete Method (String)
删除单个key

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool KeyDelete(
    string key
)

Parameters

key
Type: SystemString
redis key

Return Value

Type: Boolean
是否删除成功
See Also

Reference

RedisHelper Class
KeyDelete Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.KeyExists Method

RedisHelperKeyExists Method
判断key是否存储

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool KeyExists(
    string key
)

Parameters

key
Type: SystemString
键

Return Value

Type: Boolean
是否存储成功
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.KeyExpire Method

RedisHelperKeyExpire Method
设置Key的时间

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool KeyExpire(
    string key,
    Nullable<TimeSpan> expiry = null
)

Parameters

key
Type: SystemString
键
expiry (Optional)
Type: SystemNullable TimeSpan
过期时间

Return Value

Type: Boolean
处理结果
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.KeyRename Method

RedisHelperKeyRename Method
重新命名key

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool KeyRename(
    string key,
    string newKey
)

Parameters

key
Type: SystemString
旧的键
newKey
Type: SystemString
新的键

Return Value

Type: Boolean
处理结果
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListLeftPop(T) Method

RedisHelperListLeftPopT Method
出栈

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public T ListLeftPop<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T
数据类型

Return Value

Type: T
对象实例
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListLeftPopAsync(T) Method

RedisHelperListLeftPopAsyncT Method
出栈

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<T> ListLeftPopAsync<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T
数据类型

Return Value

Type: Task T
实例对象
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListLeftPush(T) Method

RedisHelperListLeftPushT Method
入栈

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void ListLeftPush<T>(
    string key,
    T value
)

Parameters

key
Type: SystemString
键
value
Type: T
值

Type Parameters

T
数据类型
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListLeftPushAsync(T) Method

RedisHelperListLeftPushAsyncT Method
入栈

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<long> ListLeftPushAsync<T>(
    string key,
    T value
)

Parameters

key
Type: SystemString
键
value
Type: T
值

Type Parameters

T
数据类型

Return Value

Type: Task Int64

[Missing <returns> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.ListLeftPushAsync``1(System.String,``0)"]

See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListLength Method

RedisHelperListLength Method
获取集合中的数量

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public long ListLength(
    string key
)

Parameters

key
Type: SystemString
键

Return Value

Type: Int64
数量
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListLengthAsync Method

RedisHelperListLengthAsync Method
获取集合中的数量

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<long> ListLengthAsync(
    string key
)

Parameters

key
Type: SystemString
键

Return Value

Type: Task Int64
数量
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListRange(T) Method

RedisHelperListRangeT Method
获取指定key的List

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public List<T> ListRange<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T
数据类型

Return Value

Type: List T
数据集
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListRangeAsync(T) Method

RedisHelperListRangeAsyncT Method
获取指定key的List

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<List<T>> ListRangeAsync<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T
数据类型

Return Value

Type: Task List T
数据集合
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListRemove(T) Method

RedisHelperListRemoveT Method
移除指定ListId的内部List的值

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void ListRemove<T>(
    string key,
    T value
)

Parameters

key
Type: SystemString
键
value
Type: T
值

Type Parameters

T
数据类型
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListRemoveAsync(T) Method

RedisHelperListRemoveAsyncT Method
移除指定ListId的内部List的值

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<long> ListRemoveAsync<T>(
    string key,
    T value
)

Parameters

key
Type: SystemString
键
value
Type: T
值

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.ListRemoveAsync``1(System.String,``0)"]

Return Value

Type: Task Int64

[Missing <returns> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.ListRemoveAsync``1(System.String,``0)"]

See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListRightPop(T) Method

RedisHelperListRightPopT Method
出队

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public T ListRightPop<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T
数据类型

Return Value

Type: T
值
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListRightPopAsync(T) Method

RedisHelperListRightPopAsyncT Method
出队

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<T> ListRightPopAsync<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T
数据类型

Return Value

Type: Task T
对象实例
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListRightPush(T) Method

RedisHelperListRightPushT Method
入队

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void ListRightPush<T>(
    string key,
    T value
)

Parameters

key
Type: SystemString
键
value
Type: T
值

Type Parameters

T
数据类型
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.ListRightPushAsync(T) Method

RedisHelperListRightPushAsyncT Method
入队

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<long> ListRightPushAsync<T>(
    string key,
    T value
)

Parameters

key
Type: SystemString
键
value
Type: T
值

Type Parameters

T
数据类型

Return Value

Type: Task Int64

[Missing <returns> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.ListRightPushAsync``1(System.String,``0)"]

See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.Publish(T) Method

RedisHelperPublishT Method
Redis发布订阅 发布

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public long Publish<T>(
    string channel,
    T msg
)

Parameters

channel
Type: SystemString
发布频道
msg
Type: T
消息

Type Parameters

T
消息对象

Return Value

Type: Int64
消息的数量
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.SetSysCustomKey Method

RedisHelperSetSysCustomKey Method
设置前缀

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void SetSysCustomKey(
    string customKey
)

Parameters

customKey
Type: SystemString
前缀
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.SortedSetAdd(T) Method

RedisHelperSortedSetAddT Method
添加

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool SortedSetAdd<T>(
    string key,
    T value,
    double score
)

Parameters

key
Type: SystemString
键
value
Type: T
值
score
Type: SystemDouble
排序号

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.SortedSetAdd``1(System.String,``0,System.Double)"]

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.SortedSetAdd``1(System.String,``0,System.Double)"]

See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.SortedSetAddAsync(T) Method

RedisHelperSortedSetAddAsyncT Method
添加

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<bool> SortedSetAddAsync<T>(
    string key,
    T value,
    double score
)

Parameters

key
Type: SystemString
键
value
Type: T
值
score
Type: SystemDouble
排序号

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.SortedSetAddAsync``1(System.String,``0,System.Double)"]

Return Value

Type: Task Boolean

[Missing <returns> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.SortedSetAddAsync``1(System.String,``0,System.Double)"]

See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.SortedSetLength Method

RedisHelperSortedSetLength Method
获取集合中的数量

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public long SortedSetLength(
    string key
)

Parameters

key
Type: SystemString
键

Return Value

Type: Int64
数量
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.SortedSetLengthAsync Method

RedisHelperSortedSetLengthAsync Method
获取集合中的数量

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<long> SortedSetLengthAsync(
    string key
)

Parameters

key
Type: SystemString
键

Return Value

Type: Task Int64
数量
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.SortedSetRangeByRank(T) Method

RedisHelperSortedSetRangeByRankT Method
获取全部

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public List<T> SortedSetRangeByRank<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.SortedSetRangeByRank``1(System.String)"]

Return Value

Type: List T
数据集合
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.SortedSetRangeByRankAsync(T) Method

RedisHelperSortedSetRangeByRankAsyncT Method
获取全部

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<List<T>> SortedSetRangeByRankAsync<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.SortedSetRangeByRankAsync``1(System.String)"]

Return Value

Type: Task List T
数据集合
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.SortedSetRemove(T) Method

RedisHelperSortedSetRemoveT Method
删除

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool SortedSetRemove<T>(
    string key,
    T value
)

Parameters

key
Type: SystemString
键
value
Type: T
值

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.SortedSetRemove``1(System.String,``0)"]

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.SortedSetRemove``1(System.String,``0)"]

See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.SortedSetRemoveAsync(T) Method

RedisHelperSortedSetRemoveAsyncT Method
删除

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<bool> SortedSetRemoveAsync<T>(
    string key,
    T value
)

Parameters

key
Type: SystemString
键
value
Type: T
值

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.SortedSetRemoveAsync``1(System.String,``0)"]

Return Value

Type: Task Boolean

[Missing <returns> documentation for "M:Masuit.Tools.NoSQL.RedisHelper.SortedSetRemoveAsync``1(System.String,``0)"]

See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.StringDecrement Method

RedisHelperStringDecrement Method
为数字减少val

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double StringDecrement(
    string key,
    double val = 1
)

Parameters

key
Type: SystemString
键
val (Optional)
Type: SystemDouble
可以为负

Return Value

Type: Double
减少后的值
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.StringDecrementAsync Method

RedisHelperStringDecrementAsync Method
为数字减少val

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<double> StringDecrementAsync(
    string key,
    double val = 1
)

Parameters

key
Type: SystemString
键
val (Optional)
Type: SystemDouble
可以为负

Return Value

Type: Task Double
减少后的值
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.StringGet Method

RedisHelperStringGet Method
Overload List
 | Name | Description
Public method | StringGet(ListString) | 获取多个Key
Public method | StringGet(String) | 获取单个key的值
Public method | StringGetT(String) | 获取一个key的对象
Top
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.StringGet Method (List(String))

RedisHelperStringGet Method (ListString)
获取多个Key

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public RedisValue[] StringGet(
    List<string> listKey
)

Parameters

listKey
Type: System.Collections.GenericList String
键集合

Return Value

Type: RedisValue
值集合
See Also

Reference

RedisHelper Class
StringGet Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.StringGet Method (String)

RedisHelperStringGet Method (String)
获取单个key的值

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string StringGet(
    string key
)

Parameters

key
Type: SystemString
键

Return Value

Type: String
值
See Also

Reference

RedisHelper Class
StringGet Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.StringGet(T) Method (String)

RedisHelperStringGetT Method (String)
获取一个key的对象

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public T StringGet<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T
数据类型

Return Value

Type: T
实例对象
See Also

Reference

RedisHelper Class
StringGet Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.StringGetAsync Method

RedisHelperStringGetAsync Method
Overload List
 | Name | Description
Public method | StringGetAsync(ListString) | 获取多个Key
Public method | StringGetAsync(String) | 获取单个key的值
Public method | StringGetAsyncT(String) | 获取一个key的对象
Top
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.StringGetAsync Method (List(String))

RedisHelperStringGetAsync Method (ListString)
获取多个Key

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<RedisValue[]> StringGetAsync(
    List<string> listKey
)

Parameters

listKey
Type: System.Collections.GenericList String
键集合

Return Value

Type: Task RedisValue
值集合
See Also

Reference

RedisHelper Class
StringGetAsync Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.StringGetAsync Method (String)

RedisHelperStringGetAsync Method (String)
获取单个key的值

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<string> StringGetAsync(
    string key
)

Parameters

key
Type: SystemString
键

Return Value

Type: Task String
值
See Also

Reference

RedisHelper Class
StringGetAsync Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.StringGetAsync(T) Method (String)

RedisHelperStringGetAsyncT Method (String)
获取一个key的对象

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<T> StringGetAsync<T>(
    string key
)

Parameters

key
Type: SystemString
键

Type Parameters

T
数据类型

Return Value

Type: Task T
实例对象
See Also

Reference

RedisHelper Class
StringGetAsync Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.StringIncrement Method

RedisHelperStringIncrement Method
为数字增长val

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public double StringIncrement(
    string key,
    double val = 1
)

Parameters

key
Type: SystemString
键
val (Optional)
Type: SystemDouble
可以为负

Return Value

Type: Double
增长后的值
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.StringIncrementAsync Method

RedisHelperStringIncrementAsync Method
为数字增长val

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<double> StringIncrementAsync(
    string key,
    double val = 1
)

Parameters

key
Type: SystemString
键
val (Optional)
Type: SystemDouble
可以为负

Return Value

Type: Task Double
增长后的值
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.StringSet Method

RedisHelperStringSet Method
Overload List
 | Name | Description
Public method | StringSet(ListKeyValuePairRedisKey, RedisValue) | 保存多个key value
Public method | StringSet(String, String, NullableTimeSpan) | 保存单个key value
Public method | StringSetT(String, T, NullableTimeSpan) | 保存一个对象
Top
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.StringSet Method (List(KeyValuePair(RedisKey, RedisValue)))

RedisHelperStringSet Method (ListKeyValuePairRedisKey, RedisValue)
保存多个key value

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool StringSet(
    List<KeyValuePair<RedisKey, RedisValue>> keyValues
)

Parameters

keyValues
Type: System.Collections.GenericList KeyValuePair RedisKey, RedisValue
键值对

Return Value

Type: Boolean
是否保存成功
See Also

Reference

RedisHelper Class
StringSet Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.StringSet Method (String, String, Nullable(TimeSpan))

RedisHelperStringSet Method (String, String, NullableTimeSpan)
保存单个key value

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool StringSet(
    string key,
    string value,
    Nullable<TimeSpan> expiry = null
)

Parameters

key
Type: SystemString
Redis Key
value
Type: SystemString
保存的值
expiry (Optional)
Type: SystemNullable TimeSpan
过期时间

Return Value

Type: Boolean
是否保存成功
See Also

Reference

RedisHelper Class
StringSet Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.StringSet(T) Method (String, T, Nullable(TimeSpan))

RedisHelperStringSetT Method (String, T, NullableTimeSpan)
保存一个对象

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool StringSet<T>(
    string key,
    T obj,
    Nullable<TimeSpan> expiry = null
)

Parameters

key
Type: SystemString
键
obj
Type: T
值
expiry (Optional)
Type: SystemNullable TimeSpan
过期时间

Type Parameters

T
对象类型

Return Value

Type: Boolean
是否保存成功
See Also

Reference

RedisHelper Class
StringSet Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.StringSetAsync Method

RedisHelperStringSetAsync Method
Overload List
 | Name | Description
Public method | StringSetAsync(ListKeyValuePairRedisKey, RedisValue) | 保存多个key value
Public method | StringSetAsync(String, String, NullableTimeSpan) | 保存单个key value
Public method | StringSetAsyncT(String, T, NullableTimeSpan) | 保存一个对象
Top
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.StringSetAsync Method (List(KeyValuePair(RedisKey, RedisValue)))

RedisHelperStringSetAsync Method (ListKeyValuePairRedisKey, RedisValue)
保存多个key value

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<bool> StringSetAsync(
    List<KeyValuePair<RedisKey, RedisValue>> keyValues
)

Parameters

keyValues
Type: System.Collections.GenericList KeyValuePair RedisKey, RedisValue
键值对

Return Value

Type: Task Boolean
是否保存成功
See Also

Reference

RedisHelper Class
StringSetAsync Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.StringSetAsync Method (String, String, Nullable(TimeSpan))

RedisHelperStringSetAsync Method (String, String, NullableTimeSpan)
保存单个key value

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<bool> StringSetAsync(
    string key,
    string value,
    Nullable<TimeSpan> expiry = null
)

Parameters

key
Type: SystemString
Redis Key
value
Type: SystemString
保存的值
expiry (Optional)
Type: SystemNullable TimeSpan
过期时间

Return Value

Type: Task Boolean
是否保存成功
See Also

Reference

RedisHelper Class
StringSetAsync Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.StringSetAsync(T) Method (String, T, Nullable(TimeSpan))

RedisHelperStringSetAsyncT Method (String, T, NullableTimeSpan)
保存一个对象

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Task<bool> StringSetAsync<T>(
    string key,
    T obj,
    Nullable<TimeSpan> expiry = null
)

Parameters

key
Type: SystemString
键
obj
Type: T
需要被缓存的对象
expiry (Optional)
Type: SystemNullable TimeSpan
过期时间

Type Parameters

T
数据类型

Return Value

Type: Task Boolean
是否保存成功
See Also

Reference

RedisHelper Class
StringSetAsync Overload
Masuit.Tools.NoSQL Namespace


RedisHelper.Subscribe Method

RedisHelperSubscribe Method
Redis发布订阅 订阅

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void Subscribe(
    string subChannel,
    Action<RedisChannel, RedisValue> handler = null
)

Parameters

subChannel
Type: SystemString
订阅频道
handler (Optional)
Type: SystemAction RedisChannel, RedisValue
处理过程
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.Unsubscribe Method

RedisHelperUnsubscribe Method
Redis发布订阅 取消订阅

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void Unsubscribe(
    string channel
)

Parameters

channel
Type: SystemString
频道
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


RedisHelper.UnsubscribeAll Method

RedisHelperUnsubscribeAll Method
Redis发布订阅 取消全部订阅

Namespace: Masuit.Tools.NoSQL
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void UnsubscribeAll()
See Also

Reference

RedisHelper Class
Masuit.Tools.NoSQL Namespace


Masuit.Tools.Objects Namespace

Masuit.Tools.Objects Namespace

[Missing <summary> documentation for "N:Masuit.Tools.Objects"]

Classes
 | Class | Description
Public class | ObjectExt | Object扩展类


ObjectExt Class

ObjectExt Class
Object扩展类
Inheritance Hierarchy
SystemObject
Masuit.Tools.ObjectsObjectExt

Namespace: Masuit.Tools.Objects
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class ObjectExt

The ObjectExt type exposes the following members.

Methods
Name | Description
ReferenceEquals | 严格比较两个对象是否是同一对象
Top
See Also

Reference

Masuit.Tools.Objects Namespace


ObjectExt Methods

ObjectExt Methods

The ObjectExt type exposes the following members.

Methods
Name | Description
ReferenceEquals | 严格比较两个对象是否是同一对象
Top
See Also

Reference

ObjectExt Class
Masuit.Tools.Objects Namespace


ObjectExt.ReferenceEquals Method

ObjectExtReferenceEquals Method
严格比较两个对象是否是同一对象

Namespace: Masuit.Tools.Objects
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool ReferenceEquals(
    this Object _this,
    Object o
)

Parameters

_this
Type: SystemObject
自己
o
Type: SystemObject
需要比较的对象

Return Value

Type: Boolean
是否同一对象

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ObjectExt Class
Masuit.Tools.Objects Namespace


Masuit.Tools.Reflection Namespace

Masuit.Tools.Reflection Namespace

[Missing <summary> documentation for "N:Masuit.Tools.Reflection"]

Classes
 | Class | Description
Public class | ReflectHelper | 反射辅助类
Public class | ReflectionUtil | 反射操作辅助类，如获取或设置字段、属性的值等反射信息。


ReflectHelper Class

ReflectHelper Class
反射辅助类
Inheritance Hierarchy
SystemObject
Masuit.Tools.ReflectionReflectHelper

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class ReflectHelper

The ReflectHelper type exposes the following members.

Methods
Name | Description
GetInstanceValue | 获取实体相关属性的值
GetManifestString | 获取程序集嵌入资源的文本形式
GetStringRes | 获取程序集资源的文本资源
InvokeFunctionT | 调用相关实体类型的函数方法
InvokeMethodOrGetPropertyT | 直接调用内部对象的方法/函数或获取属性(支持重载调用)
LoadBitmap | 获取程序集资源的位图资源
Top
See Also

Reference

Masuit.Tools.Reflection Namespace


ReflectHelper Methods

ReflectHelper Methods

The ReflectHelper type exposes the following members.

Methods
Name | Description
GetInstanceValue | 获取实体相关属性的值
GetManifestString | 获取程序集嵌入资源的文本形式
GetStringRes | 获取程序集资源的文本资源
InvokeFunctionT | 调用相关实体类型的函数方法
InvokeMethodOrGetPropertyT | 直接调用内部对象的方法/函数或获取属性(支持重载调用)
LoadBitmap | 获取程序集资源的位图资源
Top
See Also

Reference

ReflectHelper Class
Masuit.Tools.Reflection Namespace


ReflectHelper.GetInstanceValue Method

ReflectHelperGetInstanceValue Method
获取实体相关属性的值

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Object GetInstanceValue(
    this Object obj,
    string propertyName
)

Parameters

obj
Type: SystemObject
反射对象
propertyName
Type: SystemString
属性名

Return Value

Type: Object
属性值

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectHelper Class
Masuit.Tools.Reflection Namespace


ReflectHelper.GetManifestString Method

ReflectHelperGetManifestString Method
获取程序集嵌入资源的文本形式

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetManifestString(
    this Type assemblyType,
    string charset,
    string ResName
)

Parameters

assemblyType
Type: SystemType
程序集中的某一对象类型
charset
Type: SystemString
字符集编码
ResName
Type: SystemString
嵌入资源相对路径

Return Value

Type: String
如没找到该资源则返回空字符

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectHelper Class
Masuit.Tools.Reflection Namespace


ReflectHelper.GetStringRes Method

ReflectHelperGetStringRes Method
获取程序集资源的文本资源

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetStringRes(
    this Type assemblyType,
    string resName,
    string resourceHolder
)

Parameters

assemblyType
Type: SystemType
程序集中的某一对象类型
resName
Type: SystemString
资源项名称
resourceHolder
Type: SystemString
资源的根名称。例如，名为“MyResource.en-US.resources”的资源文件的根名称为“MyResource”。

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Reflection.ReflectHelper.GetStringRes(System.Type,System.String,System.String)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectHelper Class
Masuit.Tools.Reflection Namespace


ReflectHelper.InvokeFunction(T) Method

ReflectHelperInvokeFunctionT Method
调用相关实体类型的函数方法

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T InvokeFunction<T>(
    this Type refType,
    string funName,
    params Object[] funParams
)

Parameters

refType
Type: SystemType
实体类型
funName
Type: SystemString
函数名称
funParams
Type: SystemObject
函数参数列表

Type Parameters

T
泛型T

Return Value

Type: T
调用该函数之后的结果

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectHelper Class
Masuit.Tools.Reflection Namespace


ReflectHelper.InvokeMethodOrGetProperty(T) Method

ReflectHelperInvokeMethodOrGetPropertyT Method
直接调用内部对象的方法/函数或获取属性(支持重载调用)

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T InvokeMethodOrGetProperty<T>(
    this Type refType,
    string funName,
    Object[] objInitial,
    params Object[] funParams
)

Parameters

refType
Type: SystemType
目标数据类型
funName
Type: SystemString
函数名称，区分大小写。
objInitial
Type: SystemObject
如果调用属性，则为相关对象的初始化数据，否则为Null。
funParams
Type: SystemObject
函数参数信息

Type Parameters

T
泛型T

Return Value

Type: T
运行结果

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
Exception | Condition
InvalidProgramException | 非法异常
See Also

Reference

ReflectHelper Class
Masuit.Tools.Reflection Namespace


ReflectHelper.LoadBitmap Method

ReflectHelperLoadBitmap Method
获取程序集资源的位图资源

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Bitmap LoadBitmap(
    this Type assemblyType,
    string resourceHolder,
    string imageName
)

Parameters

assemblyType
Type: SystemType
程序集中的某一对象类型
resourceHolder
Type: SystemString
资源的根名称。例如，名为“MyResource.en-US.resources”的资源文件的根名称为“MyResource”。
imageName
Type: SystemString
资源项名称

Return Value

Type: Bitmap

[Missing <returns> documentation for "M:Masuit.Tools.Reflection.ReflectHelper.LoadBitmap(System.Type,System.String,System.String)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectHelper Class
Masuit.Tools.Reflection Namespace


ReflectionUtil Class

ReflectionUtil Class
反射操作辅助类，如获取或设置字段、属性的值等反射信息。
Inheritance Hierarchy
SystemObject
Masuit.Tools.ReflectionReflectionUtil

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class ReflectionUtil

The ReflectionUtil type exposes the following members.

Methods
Name | Description
CreateInstanceT(String) | 创建对应实例
CreateInstanceT(Type) | 创建对应实例
GetAttribute(Type, Assembly) | Gets the specified object attributes for assembly as specified by type
GetAttribute(Type, MemberInfo) | Gets the specified object attributes for type as specified by type
GetAttribute(Type, MemberInfo, Boolean) | Gets the specified object attributes for type as specified by type with option to serach parent
GetAttributes(Type, MemberInfo) | Gets the collection of all specified object attributes for type as specified by type
GetAttributes(Type, MemberInfo, Boolean) | Gets the collection of all specified object attributes for type as specified by type with option to serach parent
GetDescription(Enum) | Get The Enum Field Description using Description Attribute.
GetDescription(MemberInfo) | Get The Type Description using Description Attribute.
GetDescription(Enum, Object) | Get The Enum Field Description using Description Attribute and objects to format the Description.
GetDescription(MemberInfo, Object) | Get The Type Description using Description Attribute and objects to format the Description.
GetFieldT | 获取字段
GetFields | 获取所有的字段信息
GetImageResource | 根据资源名称获取图片资源流
GetManifestString | 获取程序集嵌入资源的文本形式
GetProperties | 获取所有的属性信息
GetPropertyT | 获取属性
GetStringRes | 获取程序集资源的文本资源
InvokeMethodT | 执行方法
LoadBitmap | 获取程序集资源的位图资源
SetField | 设置字段
SetProperty | 设置属性
Top
Fields
Name | Description
bf |
Top
See Also

Reference

Masuit.Tools.Reflection Namespace


ReflectionUtil Fields

ReflectionUtil Fields

The ReflectionUtil type exposes the following members.

Fields
Name | Description
bf |
Top
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.bf Field

ReflectionUtilbf Field

[Missing <summary> documentation for "F:Masuit.Tools.Reflection.ReflectionUtil.bf"]

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static BindingFlags bf

Field Value

Type: BindingFlags
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil Methods

ReflectionUtil Methods

The ReflectionUtil type exposes the following members.

Methods
Name | Description
CreateInstanceT(String) | 创建对应实例
CreateInstanceT(Type) | 创建对应实例
GetAttribute(Type, Assembly) | Gets the specified object attributes for assembly as specified by type
GetAttribute(Type, MemberInfo) | Gets the specified object attributes for type as specified by type
GetAttribute(Type, MemberInfo, Boolean) | Gets the specified object attributes for type as specified by type with option to serach parent
GetAttributes(Type, MemberInfo) | Gets the collection of all specified object attributes for type as specified by type
GetAttributes(Type, MemberInfo, Boolean) | Gets the collection of all specified object attributes for type as specified by type with option to serach parent
GetDescription(Enum) | Get The Enum Field Description using Description Attribute.
GetDescription(MemberInfo) | Get The Type Description using Description Attribute.
GetDescription(Enum, Object) | Get The Enum Field Description using Description Attribute and objects to format the Description.
GetDescription(MemberInfo, Object) | Get The Type Description using Description Attribute and objects to format the Description.
GetFieldT | 获取字段
GetFields | 获取所有的字段信息
GetImageResource | 根据资源名称获取图片资源流
GetManifestString | 获取程序集嵌入资源的文本形式
GetProperties | 获取所有的属性信息
GetPropertyT | 获取属性
GetStringRes | 获取程序集资源的文本资源
InvokeMethodT | 执行方法
LoadBitmap | 获取程序集资源的位图资源
SetField | 设置字段
SetProperty | 设置属性
Top
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.CreateInstance Method

ReflectionUtilCreateInstance Method
Overload List
Name | Description
CreateInstanceT(String) | 创建对应实例
CreateInstanceT(Type) | 创建对应实例
Top
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.CreateInstance(T) Method (String)

ReflectionUtilCreateInstanceT Method (String)
创建对应实例

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T CreateInstance<T>(
    string type
)
where T : class

Parameters

type
Type: SystemString
类型

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:Masuit.Tools.Reflection.ReflectionUtil.CreateInstance``1(System.String)"]

Return Value

Type: T
对应实例
See Also

Reference

ReflectionUtil Class
CreateInstance Overload
Masuit.Tools.Reflection Namespace


ReflectionUtil.CreateInstance(T) Method (Type)

ReflectionUtilCreateInstanceT Method (Type)
创建对应实例

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T CreateInstance<T>(
    this Type type
)
where T : class

Parameters

type
Type: SystemType
类型

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:Masuit.Tools.Reflection.ReflectionUtil.CreateInstance``1(System.Type)"]

Return Value

Type: T
对应实例

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
CreateInstance Overload
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetAttribute Method

ReflectionUtilGetAttribute Method
Gets the specified object attributes
Overload List
Name | Description
GetAttribute(Type, Assembly) | Gets the specified object attributes for assembly as specified by type
GetAttribute(Type, MemberInfo) | Gets the specified object attributes for type as specified by type
GetAttribute(Type, MemberInfo, Boolean) | Gets the specified object attributes for type as specified by type with option to serach parent
Top
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetAttribute Method (Type, Assembly)

ReflectionUtilGetAttribute Method (Type, Assembly)
Gets the specified object attributes for assembly as specified by type

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Object GetAttribute(
    this Type attributeType,
    Assembly assembly
)

Parameters

attributeType
Type: SystemType
The attribute Type for which the custom attributes are to be returned.
assembly
Type: System.ReflectionAssembly
the assembly in which the specified attribute is defined

Return Value

Type: Object
Attribute as Object or null if not found.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
Exception | Condition
ArgumentNullException | attributeType"/> is null.
See Also

Reference

ReflectionUtil Class
GetAttribute Overload
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetAttribute Method (Type, MemberInfo)

ReflectionUtilGetAttribute Method (Type, MemberInfo)
Gets the specified object attributes for type as specified by type

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Object GetAttribute(
    this Type attributeType,
    MemberInfo type
)

Parameters

attributeType
Type: SystemType
The attribute Type for which the custom attributes are to be returned.
type
Type: System.ReflectionMemberInfo
the type on which the specified attribute is defined

Return Value

Type: Object
Attribute as Object or null if not found.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
GetAttribute Overload
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetAttribute Method (Type, MemberInfo, Boolean)

ReflectionUtilGetAttribute Method (Type, MemberInfo, Boolean)
Gets the specified object attributes for type as specified by type with option to serach parent

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Object GetAttribute(
    this Type attributeType,
    MemberInfo type,
    bool searchParent
)

Parameters

attributeType
Type: SystemType
The attribute Type for which the custom attributes are to be returned.
type
Type: System.ReflectionMemberInfo
the type on which the specified attribute is defined
searchParent
Type: SystemBoolean
if set to [search parent].

Return Value

Type: Object
Attribute as Object or null if not found.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
GetAttribute Overload
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetAttributes Method

ReflectionUtilGetAttributes Method
Overload List
Name | Description
GetAttributes(Type, MemberInfo) | Gets the collection of all specified object attributes for type as specified by type
GetAttributes(Type, MemberInfo, Boolean) | Gets the collection of all specified object attributes for type as specified by type with option to serach parent
Top
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetAttributes Method (Type, MemberInfo)

ReflectionUtilGetAttributes Method (Type, MemberInfo)
Gets the collection of all specified object attributes for type as specified by type

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Object[] GetAttributes(
    this Type attributeType,
    MemberInfo type
)

Parameters

attributeType
Type: SystemType
The attribute Type for which the custom attributes are to be returned.
type
Type: System.ReflectionMemberInfo
the type on which the specified attribute is defined

Return Value

Type: Object
Attribute as Object or null if not found.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
GetAttributes Overload
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetAttributes Method (Type, MemberInfo, Boolean)

ReflectionUtilGetAttributes Method (Type, MemberInfo, Boolean)
Gets the collection of all specified object attributes for type as specified by type with option to serach parent

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Object[] GetAttributes(
    this Type attributeType,
    MemberInfo type,
    bool searchParent
)

Parameters

attributeType
Type: SystemType
The attribute Type for which the custom attributes are to be returned.
type
Type: System.ReflectionMemberInfo
the type on which the specified attribute is defined
searchParent
Type: SystemBoolean
The attribute Type for which the custom attribute is to be returned.

Return Value

Type: Object
Attribute as Object or null if not found.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
GetAttributes Overload
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetDescription Method

ReflectionUtilGetDescription Method
Get The Member Description using Description Attribute.
Overload List
Name | Description
GetDescription(Enum) | Get The Enum Field Description using Description Attribute.
GetDescription(MemberInfo) | Get The Type Description using Description Attribute.
GetDescription(Enum, Object) | Get The Enum Field Description using Description Attribute and objects to format the Description.
GetDescription(MemberInfo, Object) | Get The Type Description using Description Attribute and objects to format the Description.
Top
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetDescription Method (Enum)

ReflectionUtilGetDescription Method (Enum)
Get The Enum Field Description using Description Attribute.

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetDescription(
    this Enum value
)

Parameters

value
Type: SystemEnum
The value.

Return Value

Type: String
return description or value.ToString()

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Enum. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
GetDescription Overload
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetDescription Method (MemberInfo)

ReflectionUtilGetDescription Method (MemberInfo)
Get The Type Description using Description Attribute.

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetDescription(
    this MemberInfo member
)

Parameters

member
Type: System.ReflectionMemberInfo
Specified Member for which Info is Required

Return Value

Type: String
return null if DescriptionAttribute is not found or return type description

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type MemberInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
GetDescription Overload
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetDescription Method (Enum, Object[])

ReflectionUtilGetDescription Method (Enum, Object)
Get The Enum Field Description using Description Attribute and objects to format the Description.

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetDescription(
    this Enum value,
    params Object[] args
)

Parameters

value
Type: SystemEnum
Enum For Which description is required.
args
Type: SystemObject
An Object array containing zero or more objects to format.

Return Value

Type: String
return null if DescriptionAttribute is not found or return type description

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Enum. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
Exception | Condition
ArgumentNullException | value"/> is null.
See Also

Reference

ReflectionUtil Class
GetDescription Overload
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetDescription Method (MemberInfo, Object[])

ReflectionUtilGetDescription Method (MemberInfo, Object)
Get The Type Description using Description Attribute and objects to format the Description.

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetDescription(
    this MemberInfo member,
    params Object[] args
)

Parameters

member
Type: System.ReflectionMemberInfo
Specified Member for which Info is Required
args
Type: SystemObject
An Object array containing zero or more objects to format.

Return Value

Type: String
return Empty if DescriptionAttribute is not found or return type description

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type MemberInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
Exception | Condition
ArgumentNullException | member"/> is null.
See Also

Reference

ReflectionUtil Class
GetDescription Overload
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetField(T) Method

ReflectionUtilGetFieldT Method
获取字段

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T GetField<T>(
    this Object obj,
    string name
)
where T : class

Parameters

obj
Type: SystemObject
反射对象
name
Type: SystemString
字段名

Type Parameters

T
约束返回的T必须是引用类型

Return Value

Type: T
T类型

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetFields Method

ReflectionUtilGetFields Method
获取所有的字段信息

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static FieldInfo[] GetFields(
    this Object obj
)

Parameters

obj
Type: SystemObject
反射对象

Return Value

Type: FieldInfo
字段信息

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetImageResource Method

ReflectionUtilGetImageResource Method
根据资源名称获取图片资源流

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Stream GetImageResource(
    string resourceName
)

Parameters

resourceName
Type: SystemString
资源的名称

Return Value

Type: Stream
数据流
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetManifestString Method

ReflectionUtilGetManifestString Method
获取程序集嵌入资源的文本形式

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetManifestString(
    this Type assemblyType,
    string charset,
    string ResName
)

Parameters

assemblyType
Type: SystemType
程序集中的某一对象类型
charset
Type: SystemString
字符集编码
ResName
Type: SystemString
嵌入资源相对路径

Return Value

Type: String
如没找到该资源则返回空字符

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetProperties Method

ReflectionUtilGetProperties Method
获取所有的属性信息

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static PropertyInfo[] GetProperties(
    this Object obj
)

Parameters

obj
Type: SystemObject
反射对象

Return Value

Type: PropertyInfo
属性信息

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetProperty(T) Method

ReflectionUtilGetPropertyT Method
获取属性

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T GetProperty<T>(
    this Object obj,
    string name
)
where T : class

Parameters

obj
Type: SystemObject
反射对象
name
Type: SystemString
属性名

Type Parameters

T
约束返回的T必须是引用类型

Return Value

Type: T
T类型

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.GetStringRes Method

ReflectionUtilGetStringRes Method
获取程序集资源的文本资源

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetStringRes(
    this Type assemblyType,
    string resName,
    string resourceHolder
)

Parameters

assemblyType
Type: SystemType
程序集中的某一对象类型
resName
Type: SystemString
资源项名称
resourceHolder
Type: SystemString
资源的根名称。例如，名为“MyResource.en-US.resources”的资源文件的根名称为“MyResource”。

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Reflection.ReflectionUtil.GetStringRes(System.Type,System.String,System.String)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.InvokeMethod(T) Method

ReflectionUtilInvokeMethodT Method
执行方法

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static T InvokeMethod<T>(
    this Object obj,
    string methodName,
    Object[] args
)
where T : class

Parameters

obj
Type: SystemObject
反射对象
methodName
Type: SystemString
方法名，区分大小写
args
Type: SystemObject
方法参数

Type Parameters

T
约束返回的T必须是引用类型

Return Value

Type: T
T类型

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.LoadBitmap Method

ReflectionUtilLoadBitmap Method
获取程序集资源的位图资源

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Bitmap LoadBitmap(
    this Type assemblyType,
    string resourceHolder,
    string imageName
)

Parameters

assemblyType
Type: SystemType
程序集中的某一对象类型
resourceHolder
Type: SystemString
资源的根名称。例如，名为“MyResource.en-US.resources”的资源文件的根名称为“MyResource”。
imageName
Type: SystemString
资源项名称

Return Value

Type: Bitmap

[Missing <returns> documentation for "M:Masuit.Tools.Reflection.ReflectionUtil.LoadBitmap(System.Type,System.String,System.String)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.SetField Method

ReflectionUtilSetField Method
设置字段

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetField(
    this Object obj,
    string name,
    Object value
)

Parameters

obj
Type: SystemObject
反射对象
name
Type: SystemString
字段名
value
Type: SystemObject
值

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


ReflectionUtil.SetProperty Method

ReflectionUtilSetProperty Method
设置属性

Namespace: Masuit.Tools.Reflection
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetProperty(
    this Object obj,
    string name,
    Object value
)

Parameters

obj
Type: SystemObject
反射对象
name
Type: SystemString
属性名
value
Type: SystemObject
值

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

ReflectionUtil Class
Masuit.Tools.Reflection Namespace


Masuit.Tools.Security Namespace

Masuit.Tools.Security Namespace

[Missing <summary> documentation for "N:Masuit.Tools.Security"]

Classes
 | Class | Description
Public class | EncodeHelper | DES对称加解密、AES RijndaelManaged加解密、Base64加密解密、MD5加密等操作辅助类
Public class | Encrypt | 常用的加密解密算法
Public class | HashEncode | 得到随机安全码（哈希加密）。
Public class | RC2 | RC2加密解密算法
Public class | Rijndael | 对称加密解密算法类
Public class | RSACryption | RSA加密解密及RSA签名和验证


EncodeHelper Class

EncodeHelper Class
DES对称加解密、AES RijndaelManaged加解密、Base64加密解密、MD5加密等操作辅助类
Inheritance Hierarchy
SystemObject
Masuit.Tools.SecurityEncodeHelper

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class EncodeHelper

The EncodeHelper type exposes the following members.

Methods
Name | Description
AES_Decrypt(String) | 对称加密算法AES RijndaelManaged解密字符串
AES_Decrypt(String, String) | 对称加密算法AES RijndaelManaged解密字符串
AES_DecryptFile | 对指定的文件解压缩
AES_DecryptStream | 解密文件流
AES_Encrypt(String) | 对称加密算法AES RijndaelManaged加密(RijndaelManaged（AES）算法是块式加密算法)
AES_Encrypt(String, String) | 对称加密算法AES RijndaelManaged加密(RijndaelManaged（AES）算法是块式加密算法)
AES_EncryptFile | 对指定文件加密
AES_EncryptStrream | 加密文件流
Base64Decrypt | Base64解密
Base64Encrypt | Base64是一種使用64基的位置計數法。它使用2的最大次方來代表僅可列印的ASCII 字元。 這使它可用來作為電子郵件的傳輸編碼。在Base64中的變數使用字元A-Z、a-z和0-9 ， 這樣共有62個字元，用來作為開始的64個數字，最後兩個用來作為數字的符號在不同的 系統中而不同。 Base64加密
DesDecrypt(String) | 使用默认解密
DesDecrypt(String, String) | Decrypt string Attention:key must be 8 bits
DesDecrypt(String, String, String) | Decrypt files Attention:key must be 8 bits
DesEncrypt(String) | 使用默认加密
DesEncrypt(String, String) | 解密字符串 加密密钥必须是8位
DesEncrypt(String, String, String) | Encrypt files Attention:key must be 8 bits
EncyptMD5_3_16 | MD5 三次加密算法.计算过程: (QQ使用) 1. 验证码转为大写 2. 将密码使用这个方法进行三次加密后,与验证码进行叠加 3. 然后将叠加后的内容再次MD5一下,得到最终验证码的值
MD5Encrypt | MD5加密
SHA256 | SHA256函数
Top
Fields
Name | Description
DEFAULT_ENCRYPT_KEY | 默认的加密密钥
Top
See Also

Reference

Masuit.Tools.Security Namespace


EncodeHelper Fields

EncodeHelper Fields

The EncodeHelper type exposes the following members.

Fields
Name | Description
DEFAULT_ENCRYPT_KEY | 默认的加密密钥
Top
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.DEFAULT_ENCRYPT_KEY Field

EncodeHelperDEFAULT_ENCRYPT_KEY Field
默认的加密密钥

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public const string DEFAULT_ENCRYPT_KEY

Field Value

Type: String
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper Methods

EncodeHelper Methods

The EncodeHelper type exposes the following members.

Methods
Name | Description
AES_Decrypt(String) | 对称加密算法AES RijndaelManaged解密字符串
AES_Decrypt(String, String) | 对称加密算法AES RijndaelManaged解密字符串
AES_DecryptFile | 对指定的文件解压缩
AES_DecryptStream | 解密文件流
AES_Encrypt(String) | 对称加密算法AES RijndaelManaged加密(RijndaelManaged（AES）算法是块式加密算法)
AES_Encrypt(String, String) | 对称加密算法AES RijndaelManaged加密(RijndaelManaged（AES）算法是块式加密算法)
AES_EncryptFile | 对指定文件加密
AES_EncryptStrream | 加密文件流
Base64Decrypt | Base64解密
Base64Encrypt | Base64是一種使用64基的位置計數法。它使用2的最大次方來代表僅可列印的ASCII 字元。 這使它可用來作為電子郵件的傳輸編碼。在Base64中的變數使用字元A-Z、a-z和0-9 ， 這樣共有62個字元，用來作為開始的64個數字，最後兩個用來作為數字的符號在不同的 系統中而不同。 Base64加密
DesDecrypt(String) | 使用默认解密
DesDecrypt(String, String) | Decrypt string Attention:key must be 8 bits
DesDecrypt(String, String, String) | Decrypt files Attention:key must be 8 bits
DesEncrypt(String) | 使用默认加密
DesEncrypt(String, String) | 解密字符串 加密密钥必须是8位
DesEncrypt(String, String, String) | Encrypt files Attention:key must be 8 bits
EncyptMD5_3_16 | MD5 三次加密算法.计算过程: (QQ使用) 1. 验证码转为大写 2. 将密码使用这个方法进行三次加密后,与验证码进行叠加 3. 然后将叠加后的内容再次MD5一下,得到最终验证码的值
MD5Encrypt | MD5加密
SHA256 | SHA256函数
Top
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.AES_Decrypt Method

EncodeHelperAES_Decrypt Method
Overload List
Name | Description
AES_Decrypt(String) | 对称加密算法AES RijndaelManaged解密字符串
AES_Decrypt(String, String) | 对称加密算法AES RijndaelManaged解密字符串
Top
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.AES_Decrypt Method (String)

EncodeHelperAES_Decrypt Method (String)
对称加密算法AES RijndaelManaged解密字符串

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string AES_Decrypt(
    this string decryptString
)

Parameters

decryptString
Type: SystemString
待解密的字符串

Return Value

Type: String
解密成功返回解密后的字符串,失败返源串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
AES_Decrypt Overload
Masuit.Tools.Security Namespace


EncodeHelper.AES_Decrypt Method (String, String)

EncodeHelperAES_Decrypt Method (String, String)
对称加密算法AES RijndaelManaged解密字符串

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string AES_Decrypt(
    this string decryptString,
    string decryptKey
)

Parameters

decryptString
Type: SystemString
待解密的字符串
decryptKey
Type: SystemString
解密密钥,和加密密钥相同

Return Value

Type: String
解密成功返回解密后的字符串,失败返回空

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
AES_Decrypt Overload
Masuit.Tools.Security Namespace


EncodeHelper.AES_DecryptFile Method

EncodeHelperAES_DecryptFile Method
对指定的文件解压缩

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool AES_DecryptFile(
    this string InputFile,
    string OutputFile
)

Parameters

InputFile
Type: SystemString
输入文件
OutputFile
Type: SystemString
输出文件

Return Value

Type: Boolean
处理结果

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.AES_DecryptStream Method

EncodeHelperAES_DecryptStream Method
解密文件流

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static CryptoStream AES_DecryptStream(
    this FileStream fs,
    string decryptKey
)

Parameters

fs
Type: System.IOFileStream
需要解密的文件流
decryptKey
Type: SystemString
解密密钥

Return Value

Type: CryptoStream
加密流

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type FileStream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.AES_Encrypt Method

EncodeHelperAES_Encrypt Method
Overload List
Name | Description
AES_Encrypt(String) | 对称加密算法AES RijndaelManaged加密(RijndaelManaged（AES）算法是块式加密算法)
AES_Encrypt(String, String) | 对称加密算法AES RijndaelManaged加密(RijndaelManaged（AES）算法是块式加密算法)
Top
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.AES_Encrypt Method (String)

EncodeHelperAES_Encrypt Method (String)
对称加密算法AES RijndaelManaged加密(RijndaelManaged（AES）算法是块式加密算法)

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string AES_Encrypt(
    this string encryptString
)

Parameters

encryptString
Type: SystemString
待加密字符串

Return Value

Type: String
加密结果字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
AES_Encrypt Overload
Masuit.Tools.Security Namespace


EncodeHelper.AES_Encrypt Method (String, String)

EncodeHelperAES_Encrypt Method (String, String)
对称加密算法AES RijndaelManaged加密(RijndaelManaged（AES）算法是块式加密算法)

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string AES_Encrypt(
    this string encryptString,
    string encryptKey
)

Parameters

encryptString
Type: SystemString
待加密字符串
encryptKey
Type: SystemString
加密密钥，须半角字符

Return Value

Type: String
加密结果字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
AES_Encrypt Overload
Masuit.Tools.Security Namespace


EncodeHelper.AES_EncryptFile Method

EncodeHelperAES_EncryptFile Method
对指定文件加密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool AES_EncryptFile(
    this string InputFile,
    string OutputFile
)

Parameters

InputFile
Type: SystemString
源文件
OutputFile
Type: SystemString
输出文件

Return Value

Type: Boolean
处理结果

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.AES_EncryptStrream Method

EncodeHelperAES_EncryptStrream Method
加密文件流

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static CryptoStream AES_EncryptStrream(
    this FileStream fs,
    string decryptKey
)

Parameters

fs
Type: System.IOFileStream
需要加密的文件流
decryptKey
Type: SystemString
加密密钥

Return Value

Type: CryptoStream
加密流

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type FileStream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.Base64Decrypt Method

EncodeHelperBase64Decrypt Method
Base64解密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Base64Decrypt(
    this string str
)

Parameters

str
Type: SystemString
需要解密的字符串

Return Value

Type: String
解密后的数据

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.Base64Encrypt Method

EncodeHelperBase64Encrypt Method
Base64是一種使用64基的位置計數法。它使用2的最大次方來代表僅可列印的ASCII 字元。 這使它可用來作為電子郵件的傳輸編碼。在Base64中的變數使用字元A-Z、a-z和0-9 ， 這樣共有62個字元，用來作為開始的64個數字，最後兩個用來作為數字的符號在不同的 系統中而不同。 Base64加密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Base64Encrypt(
    this string str
)

Parameters

str
Type: SystemString
需要加密的字符串

Return Value

Type: String
加密后的数据

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.DesDecrypt Method

EncodeHelperDesDecrypt Method
Overload List
Name | Description
DesDecrypt(String) | 使用默认解密
DesDecrypt(String, String) | Decrypt string Attention:key must be 8 bits
DesDecrypt(String, String, String) | Decrypt files Attention:key must be 8 bits
Top
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.DesDecrypt Method (String)

EncodeHelperDesDecrypt Method (String)
使用默认解密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DesDecrypt(
    this string strText
)

Parameters

strText
Type: SystemString
需要解密的 字符串

Return Value

Type: String
解密后的数据

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
DesDecrypt Overload
Masuit.Tools.Security Namespace


EncodeHelper.DesDecrypt Method (String, String)

EncodeHelperDesDecrypt Method (String, String)
Decrypt string Attention:key must be 8 bits

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DesDecrypt(
    this string strText,
    string sDecrKey
)

Parameters

strText
Type: SystemString
Decrypt string
sDecrKey
Type: SystemString
key

Return Value

Type: String
output string

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
DesDecrypt Overload
Masuit.Tools.Security Namespace


EncodeHelper.DesDecrypt Method (String, String, String)

EncodeHelperDesDecrypt Method (String, String, String)
Decrypt files Attention:key must be 8 bits

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void DesDecrypt(
    this string m_InFilePath,
    string m_OutFilePath,
    string sDecrKey
)

Parameters

m_InFilePath
Type: SystemString
Decrypt filepath
m_OutFilePath
Type: SystemString
output filepath
sDecrKey
Type: SystemString
key

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
DesDecrypt Overload
Masuit.Tools.Security Namespace


EncodeHelper.DesEncrypt Method

EncodeHelperDesEncrypt Method
Overload List
Name | Description
DesEncrypt(String) | 使用默认加密
DesEncrypt(String, String) | 解密字符串 加密密钥必须是8位
DesEncrypt(String, String, String) | Encrypt files Attention:key must be 8 bits
Top
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.DesEncrypt Method (String)

EncodeHelperDesEncrypt Method (String)
使用默认加密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DesEncrypt(
    this string strText
)

Parameters

strText
Type: SystemString
被加密的字符串

Return Value

Type: String
加密后的数据

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
DesEncrypt Overload
Masuit.Tools.Security Namespace


EncodeHelper.DesEncrypt Method (String, String)

EncodeHelperDesEncrypt Method (String, String)
解密字符串 加密密钥必须是8位

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DesEncrypt(
    this string strText,
    string strEncrKey
)

Parameters

strText
Type: SystemString
被解密的字符串
strEncrKey
Type: SystemString
密钥

Return Value

Type: String
解密后的数据

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
DesEncrypt Overload
Masuit.Tools.Security Namespace


EncodeHelper.DesEncrypt Method (String, String, String)

EncodeHelperDesEncrypt Method (String, String, String)
Encrypt files Attention:key must be 8 bits

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void DesEncrypt(
    this string m_InFilePath,
    string m_OutFilePath,
    string strEncrKey
)

Parameters

m_InFilePath
Type: SystemString
Encrypt file path
m_OutFilePath
Type: SystemString
output file
strEncrKey
Type: SystemString
key

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
DesEncrypt Overload
Masuit.Tools.Security Namespace


EncodeHelper.EncyptMD5_3_16 Method

EncodeHelperEncyptMD5_3_16 Method
MD5 三次加密算法.计算过程: (QQ使用) 1. 验证码转为大写 2. 将密码使用这个方法进行三次加密后,与验证码进行叠加 3. 然后将叠加后的内容再次MD5一下,得到最终验证码的值

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string EncyptMD5_3_16(
    this string s
)

Parameters

s
Type: SystemString
需要加密的字符串

Return Value

Type: String
MD5字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.MD5Encrypt Method

EncodeHelperMD5Encrypt Method
MD5加密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string MD5Encrypt(
    this string strText
)

Parameters

strText
Type: SystemString
原数据

Return Value

Type: String
MD5字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


EncodeHelper.SHA256 Method

EncodeHelperSHA256 Method
SHA256函数

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string SHA256(
    this string str
)

Parameters

str
Type: SystemString
原始字符串

Return Value

Type: String
SHA256结果(返回长度为44字节的字符串)

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

EncodeHelper Class
Masuit.Tools.Security Namespace


Encrypt Class

Encrypt Class
常用的加密解密算法
Inheritance Hierarchy
SystemObject
Masuit.Tools.SecurityEncrypt

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class Encrypt

The Encrypt type exposes the following members.

Methods
Name | Description
ArrayToHexString | 获取数组的Hex值
DesDecrypt | DES解密算法 密钥为8位或16位
DesEncrypt | DES加密算法 密钥为8位或16位
GenerateKey | 创建Key
MD5Array | MD5对数组数据加密
MD5Decrypt | MD5解密
MD5Encrypt | MD5加密
MDFile | 获取文件的MD5值
MDString(String) | 对字符串进行MD5加密
MDString(String, String) | 对字符串进行MD5加盐加密
MDString2(String) | 对字符串进行MD5二次加密
MDString2(String, String) | 对字符串进行MD5二次加盐加密
Top
See Also

Reference

Masuit.Tools.Security Namespace


Encrypt Methods

Encrypt Methods

The Encrypt type exposes the following members.

Methods
Name | Description
ArrayToHexString | 获取数组的Hex值
DesDecrypt | DES解密算法 密钥为8位或16位
DesEncrypt | DES加密算法 密钥为8位或16位
GenerateKey | 创建Key
MD5Array | MD5对数组数据加密
MD5Decrypt | MD5解密
MD5Encrypt | MD5加密
MDFile | 获取文件的MD5值
MDString(String) | 对字符串进行MD5加密
MDString(String, String) | 对字符串进行MD5加盐加密
MDString2(String) | 对字符串进行MD5二次加密
MDString2(String, String) | 对字符串进行MD5二次加盐加密
Top
See Also

Reference

Encrypt Class
Masuit.Tools.Security Namespace


Encrypt.ArrayToHexString Method

EncryptArrayToHexString Method
获取数组的Hex值

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ArrayToHexString(
    this byte[] array,
    bool uppercase
)

Parameters

array
Type: SystemByte
需要求Hex值的数组
uppercase
Type: SystemBoolean
是否转大写

Return Value

Type: String
字节数组的16进制表示

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Encrypt Class
Masuit.Tools.Security Namespace


Encrypt.DesDecrypt Method

EncryptDesDecrypt Method
DES解密算法 密钥为8位或16位

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DesDecrypt(
    this string pToDecrypt,
    string sKey
)

Parameters

pToDecrypt
Type: SystemString
需要解密的字符串
sKey
Type: SystemString
密钥

Return Value

Type: String
解密后的数据

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Encrypt Class
Masuit.Tools.Security Namespace


Encrypt.DesEncrypt Method

EncryptDesEncrypt Method
DES加密算法 密钥为8位或16位

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DesEncrypt(
    this string pToEncrypt,
    string sKey
)

Parameters

pToEncrypt
Type: SystemString
需要加密的字符串
sKey
Type: SystemString
密钥

Return Value

Type: String
解密后的数据

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Encrypt Class
Masuit.Tools.Security Namespace


Encrypt.GenerateKey Method

EncryptGenerateKey Method
创建Key

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GenerateKey()

Return Value

Type: String
密钥
See Also

Reference

Encrypt Class
Masuit.Tools.Security Namespace


Encrypt.MD5Array Method

EncryptMD5Array Method
MD5对数组数据加密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static byte[] MD5Array(
    this byte[] input
)

Parameters

input
Type: SystemByte
包含需要加密的数据的数组

Return Value

Type: Byte
加密后的字节流

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Encrypt Class
Masuit.Tools.Security Namespace


Encrypt.MD5Decrypt Method

EncryptMD5Decrypt Method
MD5解密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string MD5Decrypt(
    this string pToDecrypt,
    string sKey
)

Parameters

pToDecrypt
Type: SystemString
解密字符串
sKey
Type: SystemString
密钥Key

Return Value

Type: String
解密后的数据

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Encrypt Class
Masuit.Tools.Security Namespace


Encrypt.MD5Encrypt Method

EncryptMD5Encrypt Method
MD5加密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string MD5Encrypt(
    this string pToEncrypt,
    string sKey
)

Parameters

pToEncrypt
Type: SystemString
加密字符串
sKey
Type: SystemString
密钥Key

Return Value

Type: String
加密后的字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Encrypt Class
Masuit.Tools.Security Namespace


Encrypt.MDFile Method

EncryptMDFile Method
获取文件的MD5值

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string MDFile(
    this string fileName
)

Parameters

fileName
Type: SystemString
需要求MD5值的文件的文件名及路径

Return Value

Type: String
MD5字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Encrypt Class
Masuit.Tools.Security Namespace


Encrypt.MDString Method

EncryptMDString Method
Overload List
Name | Description
MDString(String) | 对字符串进行MD5加密
MDString(String, String) | 对字符串进行MD5加盐加密
Top
See Also

Reference

Encrypt Class
Masuit.Tools.Security Namespace


Encrypt.MDString Method (String)

EncryptMDString Method (String)
对字符串进行MD5加密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string MDString(
    this string message
)

Parameters

message
Type: SystemString
需要加密的字符串

Return Value

Type: String
加密后的结果

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Encrypt Class
MDString Overload
Masuit.Tools.Security Namespace


Encrypt.MDString Method (String, String)

EncryptMDString Method (String, String)
对字符串进行MD5加盐加密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string MDString(
    this string message,
    string salt
)

Parameters

message
Type: SystemString
需要加密的字符串
salt
Type: SystemString
盐

Return Value

Type: String
加密后的结果

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Encrypt Class
MDString Overload
Masuit.Tools.Security Namespace


Encrypt.MDString2 Method

EncryptMDString2 Method
Overload List
Name | Description
MDString2(String) | 对字符串进行MD5二次加密
MDString2(String, String) | 对字符串进行MD5二次加盐加密
Top
See Also

Reference

Encrypt Class
Masuit.Tools.Security Namespace


Encrypt.MDString2 Method (String)

EncryptMDString2 Method (String)
对字符串进行MD5二次加密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string MDString2(
    this string message
)

Parameters

message
Type: SystemString
需要加密的字符串

Return Value

Type: String
加密后的结果

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Encrypt Class
MDString2 Overload
Masuit.Tools.Security Namespace


Encrypt.MDString2 Method (String, String)

EncryptMDString2 Method (String, String)
对字符串进行MD5二次加盐加密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string MDString2(
    this string message,
    string salt
)

Parameters

message
Type: SystemString
需要加密的字符串
salt
Type: SystemString
盐

Return Value

Type: String
加密后的结果

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Encrypt Class
MDString2 Overload
Masuit.Tools.Security Namespace


HashEncode Class

HashEncode Class
得到随机安全码（哈希加密）。
Inheritance Hierarchy
SystemObject
Masuit.Tools.SecurityHashEncode

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class HashEncode

The HashEncode type exposes the following members.

Constructors
 | Name | Description
Public method | HashEncode | 哈希加密
Top
Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
 | GetRandomValue | 得到一个随机数值
 | GetSecurity | 得到随机哈希加密字符串
Public method | GetType | (Inherited from Object.)
 | HashEncoding | 哈希加密一个字符串
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

Masuit.Tools.Security Namespace


HashEncode Constructor

HashEncode Constructor
哈希加密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public HashEncode()
See Also

Reference

HashEncode Class
Masuit.Tools.Security Namespace


HashEncode Methods

HashEncode Methods

The HashEncode type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
 | GetRandomValue | 得到一个随机数值
 | GetSecurity | 得到随机哈希加密字符串
Public method | GetType | (Inherited from Object.)
 | HashEncoding | 哈希加密一个字符串
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

HashEncode Class
Masuit.Tools.Security Namespace


HashEncode.GetRandomValue Method

HashEncodeGetRandomValue Method
得到一个随机数值

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetRandomValue()

Return Value

Type: String
随机数值
See Also

Reference

HashEncode Class
Masuit.Tools.Security Namespace


HashEncode.GetSecurity Method

HashEncodeGetSecurity Method
得到随机哈希加密字符串

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetSecurity()

Return Value

Type: String
随机哈希加密字符串
See Also

Reference

HashEncode Class
Masuit.Tools.Security Namespace


HashEncode.HashEncoding Method

HashEncodeHashEncoding Method
哈希加密一个字符串

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string HashEncoding(
    string Security
)

Parameters

Security
Type: SystemString
需要加密的字符串

Return Value

Type: String
加密后的数据
See Also

Reference

HashEncode Class
Masuit.Tools.Security Namespace


RC2 Class

RC2 Class
RC2加密解密算法
Inheritance Hierarchy
SystemObject
Masuit.Tools.SecurityRC2

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class RC2

The RC2 type exposes the following members.

Methods
Name | Description
DecryptFromFile(String) | 将一个被加密的文件解密
DecryptFromFile(String, Int32) | 从一个文件中解密出一段文本，其中，这个文件是由InitBinFile建立的，并且由 EncryptToFile加密的
DecryptFromFile(String, Byte, Byte) | 将一个被加密的文件解密
DecryptFromFile(String, Int32, Byte, Byte) | 从一个文件中解密出一段文本，其中，这个文件是由InitBinFile建立的，并且由 EncryptToFile加密的
EncryptToFile(String, String) | 将一段文本加密后保存到一个文件
EncryptToFile(String, String, Int32) | 将文本数据加密后写入一个文件，其中，这个文件是用InitBinFile建立的，这个文件将被分成十块， 用来分别保存10组不同的数据，第一个byte位保留，第2位到第21位分别用来存放每块数据的长度，但 一个byte的取值为0-127，所以，用两个byte来存放一个长度。
EncryptToFile(String, String, Byte, Byte) | 将一段文本加密后保存到一个文件
EncryptToFile(String, String, Int32, Byte, Byte) | 将文本数据加密后写入一个文件，其中，这个文件是用InitBinFile建立的，这个文件将被分成十块， 用来分别保存10组不同的数据，第一个byte位保留，第2位到第21位分别用来存放每块数据的长度，但 一个byte的取值为0-127，所以，用两个byte来存放一个长度。
InitBinFile | 新建一个大小为10261B的文件，以便将加密数据写入固定大小的文件。
SetIV | 设置加密或解密的初始化向量
SetKey | 设置加密或解密的密匙
Top
See Also

Reference

Masuit.Tools.Security Namespace


RC2 Methods

RC2 Methods

The RC2 type exposes the following members.

Methods
Name | Description
DecryptFromFile(String) | 将一个被加密的文件解密
DecryptFromFile(String, Int32) | 从一个文件中解密出一段文本，其中，这个文件是由InitBinFile建立的，并且由 EncryptToFile加密的
DecryptFromFile(String, Byte, Byte) | 将一个被加密的文件解密
DecryptFromFile(String, Int32, Byte, Byte) | 从一个文件中解密出一段文本，其中，这个文件是由InitBinFile建立的，并且由 EncryptToFile加密的
EncryptToFile(String, String) | 将一段文本加密后保存到一个文件
EncryptToFile(String, String, Int32) | 将文本数据加密后写入一个文件，其中，这个文件是用InitBinFile建立的，这个文件将被分成十块， 用来分别保存10组不同的数据，第一个byte位保留，第2位到第21位分别用来存放每块数据的长度，但 一个byte的取值为0-127，所以，用两个byte来存放一个长度。
EncryptToFile(String, String, Byte, Byte) | 将一段文本加密后保存到一个文件
EncryptToFile(String, String, Int32, Byte, Byte) | 将文本数据加密后写入一个文件，其中，这个文件是用InitBinFile建立的，这个文件将被分成十块， 用来分别保存10组不同的数据，第一个byte位保留，第2位到第21位分别用来存放每块数据的长度，但 一个byte的取值为0-127，所以，用两个byte来存放一个长度。
InitBinFile | 新建一个大小为10261B的文件，以便将加密数据写入固定大小的文件。
SetIV | 设置加密或解密的初始化向量
SetKey | 设置加密或解密的密匙
Top
See Also

Reference

RC2 Class
Masuit.Tools.Security Namespace


RC2.DecryptFromFile Method

RC2DecryptFromFile Method
Overload List
Name | Description
DecryptFromFile(String) | 将一个被加密的文件解密
DecryptFromFile(String, Int32) | 从一个文件中解密出一段文本，其中，这个文件是由InitBinFile建立的，并且由 EncryptToFile加密的
DecryptFromFile(String, Byte, Byte) | 将一个被加密的文件解密
DecryptFromFile(String, Int32, Byte, Byte) | 从一个文件中解密出一段文本，其中，这个文件是由InitBinFile建立的，并且由 EncryptToFile加密的
Top
See Also

Reference

RC2 Class
Masuit.Tools.Security Namespace


RC2.DecryptFromFile Method (String)

RC2DecryptFromFile Method (String)
将一个被加密的文件解密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DecryptFromFile(
    this string filePath
)

Parameters

filePath
Type: SystemString
要解密的文件

Return Value

Type: String
解密后的文本

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

RC2 Class
DecryptFromFile Overload
Masuit.Tools.Security Namespace


RC2.DecryptFromFile Method (String, Int32)

RC2DecryptFromFile Method (String, Int32)
从一个文件中解密出一段文本，其中，这个文件是由InitBinFile建立的，并且由 EncryptToFile加密的

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DecryptFromFile(
    this string filePath,
    int dataIndex
)

Parameters

filePath
Type: SystemString
要解密的文件
dataIndex
Type: SystemInt32
要从哪一个块中解密

Return Value

Type: String
解密后的文本

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

RC2 Class
DecryptFromFile Overload
Masuit.Tools.Security Namespace


RC2.DecryptFromFile Method (String, Byte[], Byte[])

RC2DecryptFromFile Method (String, Byte, Byte)
将一个被加密的文件解密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DecryptFromFile(
    this string filePath,
    byte[] IV,
    byte[] Key
)

Parameters

filePath
Type: SystemString
要解密的文件
IV
Type: SystemByte
初始化向量
Key
Type: SystemByte
解密密匙

Return Value

Type: String
解密后的文本

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

RC2 Class
DecryptFromFile Overload
Masuit.Tools.Security Namespace


RC2.DecryptFromFile Method (String, Int32, Byte[], Byte[])

RC2DecryptFromFile Method (String, Int32, Byte, Byte)
从一个文件中解密出一段文本，其中，这个文件是由InitBinFile建立的，并且由 EncryptToFile加密的

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string DecryptFromFile(
    this string filePath,
    int dataIndex,
    byte[] IV,
    byte[] Key
)

Parameters

filePath
Type: SystemString
要解密的文件
dataIndex
Type: SystemInt32
要从哪一个块中解密
IV
Type: SystemByte
初始化向量
Key
Type: SystemByte
解密密匙

Return Value

Type: String
解密后的文本

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

RC2 Class
DecryptFromFile Overload
Masuit.Tools.Security Namespace


RC2.EncryptToFile Method

RC2EncryptToFile Method
Overload List
Name | Description
EncryptToFile(String, String) | 将一段文本加密后保存到一个文件
EncryptToFile(String, String, Int32) | 将文本数据加密后写入一个文件，其中，这个文件是用InitBinFile建立的，这个文件将被分成十块， 用来分别保存10组不同的数据，第一个byte位保留，第2位到第21位分别用来存放每块数据的长度，但 一个byte的取值为0-127，所以，用两个byte来存放一个长度。
EncryptToFile(String, String, Byte, Byte) | 将一段文本加密后保存到一个文件
EncryptToFile(String, String, Int32, Byte, Byte) | 将文本数据加密后写入一个文件，其中，这个文件是用InitBinFile建立的，这个文件将被分成十块， 用来分别保存10组不同的数据，第一个byte位保留，第2位到第21位分别用来存放每块数据的长度，但 一个byte的取值为0-127，所以，用两个byte来存放一个长度。
Top
See Also

Reference

RC2 Class
Masuit.Tools.Security Namespace


RC2.EncryptToFile Method (String, String)

RC2EncryptToFile Method (String, String)
将一段文本加密后保存到一个文件

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool EncryptToFile(
    this string toEncryptText,
    string filePath
)

Parameters

toEncryptText
Type: SystemString
要加密的文本数据
filePath
Type: SystemString
要保存的文件

Return Value

Type: Boolean
是否加密成功

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

RC2 Class
EncryptToFile Overload
Masuit.Tools.Security Namespace


RC2.EncryptToFile Method (String, String, Int32)

RC2EncryptToFile Method (String, String, Int32)
将文本数据加密后写入一个文件，其中，这个文件是用InitBinFile建立的，这个文件将被分成十块， 用来分别保存10组不同的数据，第一个byte位保留，第2位到第21位分别用来存放每块数据的长度，但 一个byte的取值为0-127，所以，用两个byte来存放一个长度。

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool EncryptToFile(
    this string toEncryptText,
    string filePath,
    int dataIndex
)

Parameters

toEncryptText
Type: SystemString
要加密的文本数据
filePath
Type: SystemString
要写入的文件
dataIndex
Type: SystemInt32
写入第几块，取值为1--10

Return Value

Type: Boolean
是否操作成功

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

RC2 Class
EncryptToFile Overload
Masuit.Tools.Security Namespace


RC2.EncryptToFile Method (String, String, Byte[], Byte[])

RC2EncryptToFile Method (String, String, Byte, Byte)
将一段文本加密后保存到一个文件

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool EncryptToFile(
    this string toEncryptText,
    string filePath,
    byte[] IV,
    byte[] Key
)

Parameters

toEncryptText
Type: SystemString
要加密的文本数据
filePath
Type: SystemString
要保存的文件
IV
Type: SystemByte
初始化向量
Key
Type: SystemByte
加密密匙

Return Value

Type: Boolean
是否加密成功

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

RC2 Class
EncryptToFile Overload
Masuit.Tools.Security Namespace


RC2.EncryptToFile Method (String, String, Int32, Byte[], Byte[])

RC2EncryptToFile Method (String, String, Int32, Byte, Byte)
将文本数据加密后写入一个文件，其中，这个文件是用InitBinFile建立的，这个文件将被分成十块， 用来分别保存10组不同的数据，第一个byte位保留，第2位到第21位分别用来存放每块数据的长度，但 一个byte的取值为0-127，所以，用两个byte来存放一个长度。

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool EncryptToFile(
    this string toEncryptText,
    string filePath,
    int dataIndex,
    byte[] IV,
    byte[] Key
)

Parameters

toEncryptText
Type: SystemString
要加密的文本数据
filePath
Type: SystemString
要写入的文件
dataIndex
Type: SystemInt32
写入第几块，取值为1--10
IV
Type: SystemByte
初始化向量
Key
Type: SystemByte
加密密匙

Return Value

Type: Boolean
是否操作成功

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

RC2 Class
EncryptToFile Overload
Masuit.Tools.Security Namespace


RC2.InitBinFile Method

RC2InitBinFile Method
新建一个大小为10261B的文件，以便将加密数据写入固定大小的文件。

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string InitBinFile(
    this string filePath
)

Parameters

filePath
Type: SystemString
文件保存的地址，包含文件名

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Security.RC2.InitBinFile(System.String)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

RC2 Class
Masuit.Tools.Security Namespace


RC2.SetIV Method

RC2SetIV Method
设置加密或解密的初始化向量

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetIV(
    this string s
)

Parameters

s
Type: SystemString
长度等于8的ASCII字符集的字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

RC2 Class
Masuit.Tools.Security Namespace


RC2.SetKey Method

RC2SetKey Method
设置加密或解密的密匙

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SetKey(
    this string s
)

Parameters

s
Type: SystemString
长度等于16的ASCII字符集的字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

RC2 Class
Masuit.Tools.Security Namespace


Rijndael Class

Rijndael Class
对称加密解密算法类
Inheritance Hierarchy
SystemObject
Masuit.Tools.SecurityRijndael

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class Rijndael

The Rijndael type exposes the following members.

Methods
Name | Description
Decrypto | 解密方法
Encrypto | 加密方法
SymmetricMethod | 对称加密类的构造函数
Top
See Also

Reference

Masuit.Tools.Security Namespace


Rijndael Methods

Rijndael Methods

The Rijndael type exposes the following members.

Methods
Name | Description
Decrypto | 解密方法
Encrypto | 加密方法
SymmetricMethod | 对称加密类的构造函数
Top
See Also

Reference

Rijndael Class
Masuit.Tools.Security Namespace


Rijndael.Decrypto Method

RijndaelDecrypto Method
解密方法

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Decrypto(
    this string Source
)

Parameters

Source
Type: SystemString
待解密的串

Return Value

Type: String
经过解密的串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Rijndael Class
Masuit.Tools.Security Namespace


Rijndael.Encrypto Method

RijndaelEncrypto Method
加密方法

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Encrypto(
    this string Source
)

Parameters

Source
Type: SystemString
待加密的串

Return Value

Type: String
经过加密的串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

Rijndael Class
Masuit.Tools.Security Namespace


Rijndael.SymmetricMethod Method

RijndaelSymmetricMethod Method
对称加密类的构造函数

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void SymmetricMethod()
See Also

Reference

Rijndael Class
Masuit.Tools.Security Namespace


RSACryption Class

RSACryption Class
RSA加密解密及RSA签名和验证
Inheritance Hierarchy
SystemObject
Masuit.Tools.SecurityRSACryption

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class RSACryption

The RSACryption type exposes the following members.

Constructors
 | Name | Description
Public method | RSACryption | RSA加密
Top
Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHash(FileStream, Byte) | 从文件流获取Hash描述表
Public method | GetHash(FileStream, String) | 从文件流获取Hash描述表
Public method | GetHash(String, Byte) | 获取Hash描述表
Public method | GetHash(String, String) | 获取Hash描述表
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | RSADecrypt(String, Byte) | RSA的解密函数 byte
Public method | RSADecrypt(String, String) | RSA的解密函数 string
Public method | RSAEncrypt(String, Byte) | RSA的加密函数 byte[]
Public method | RSAEncrypt(String, String) | RSA的加密函数 string
Public method | RSAKey | RSA 的密钥产生 产生私钥 和公钥
Public method | SignatureDeformatter(String, Byte, Byte) | RSA 签名验证
Public method | SignatureDeformatter(String, Byte, String) | RSA 签名验证
Public method | SignatureDeformatter(String, String, Byte) | RSA 签名验证
Public method | SignatureDeformatter(String, String, String) | RSA 签名验证
Public method | SignatureFormatter(String, Byte, Byte) | RSA签名
Public method | SignatureFormatter(String, Byte, String) | RSA签名
Public method | SignatureFormatter(String, String, Byte) | RSA签名
Public method | SignatureFormatter(String, String, String) | RSA签名
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

Masuit.Tools.Security Namespace


RSACryption Constructor

RSACryption Constructor
RSA加密

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public RSACryption()
See Also

Reference

RSACryption Class
Masuit.Tools.Security Namespace


RSACryption Methods

RSACryption Methods

The RSACryption type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHash(FileStream, Byte) | 从文件流获取Hash描述表
Public method | GetHash(FileStream, String) | 从文件流获取Hash描述表
Public method | GetHash(String, Byte) | 获取Hash描述表
Public method | GetHash(String, String) | 获取Hash描述表
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | RSADecrypt(String, Byte) | RSA的解密函数 byte
Public method | RSADecrypt(String, String) | RSA的解密函数 string
Public method | RSAEncrypt(String, Byte) | RSA的加密函数 byte[]
Public method | RSAEncrypt(String, String) | RSA的加密函数 string
Public method | RSAKey | RSA 的密钥产生 产生私钥 和公钥
Public method | SignatureDeformatter(String, Byte, Byte) | RSA 签名验证
Public method | SignatureDeformatter(String, Byte, String) | RSA 签名验证
Public method | SignatureDeformatter(String, String, Byte) | RSA 签名验证
Public method | SignatureDeformatter(String, String, String) | RSA 签名验证
Public method | SignatureFormatter(String, Byte, Byte) | RSA签名
Public method | SignatureFormatter(String, Byte, String) | RSA签名
Public method | SignatureFormatter(String, String, Byte) | RSA签名
Public method | SignatureFormatter(String, String, String) | RSA签名
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

RSACryption Class
Masuit.Tools.Security Namespace


RSACryption.GetHash Method

RSACryptionGetHash Method
Overload List
 | Name | Description
Public method | GetHash(FileStream, Byte) | 从文件流获取Hash描述表
Public method | GetHash(FileStream, String) | 从文件流获取Hash描述表
Public method | GetHash(String, Byte) | 获取Hash描述表
Public method | GetHash(String, String) | 获取Hash描述表
Top
See Also

Reference

RSACryption Class
Masuit.Tools.Security Namespace


RSACryption.GetHash Method (FileStream, Byte[])

RSACryptionGetHash Method (FileStream, Byte)
从文件流获取Hash描述表

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool GetHash(
    FileStream objFile,
    ref byte[] HashData
)

Parameters

objFile
Type: System.IOFileStream
源文件
HashData
Type: SystemByte
哈希字节数据

Return Value

Type: Boolean
Hash描述表
See Also

Reference

RSACryption Class
GetHash Overload
Masuit.Tools.Security Namespace


RSACryption.GetHash Method (FileStream, String)

RSACryptionGetHash Method (FileStream, String)
从文件流获取Hash描述表

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool GetHash(
    FileStream objFile,
    ref string strHashData
)

Parameters

objFile
Type: System.IOFileStream
源文件
strHashData
Type: SystemString
哈希数据

Return Value

Type: Boolean
Hash描述表
See Also

Reference

RSACryption Class
GetHash Overload
Masuit.Tools.Security Namespace


RSACryption.GetHash Method (String, Byte[])

RSACryptionGetHash Method (String, Byte)
获取Hash描述表

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool GetHash(
    string m_strSource,
    ref byte[] HashData
)

Parameters

m_strSource
Type: SystemString
源数据
HashData
Type: SystemByte
哈希数据

Return Value

Type: Boolean
Hash描述表
See Also

Reference

RSACryption Class
GetHash Overload
Masuit.Tools.Security Namespace


RSACryption.GetHash Method (String, String)

RSACryptionGetHash Method (String, String)
获取Hash描述表

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool GetHash(
    string m_strSource,
    ref string strHashData
)

Parameters

m_strSource
Type: SystemString
源数据
strHashData
Type: SystemString
哈希数据

Return Value

Type: Boolean
Hash描述表
See Also

Reference

RSACryption Class
GetHash Overload
Masuit.Tools.Security Namespace


RSACryption.RSADecrypt Method

RSACryptionRSADecrypt Method
Overload List
 | Name | Description
Public method | RSADecrypt(String, Byte) | RSA的解密函数 byte
Public method | RSADecrypt(String, String) | RSA的解密函数 string
Top
See Also

Reference

RSACryption Class
Masuit.Tools.Security Namespace


RSACryption.RSADecrypt Method (String, Byte[])

RSACryptionRSADecrypt Method (String, Byte)
RSA的解密函数 byte

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string RSADecrypt(
    string xmlPrivateKey,
    byte[] DecryptString
)

Parameters

xmlPrivateKey
Type: SystemString
私钥
DecryptString
Type: SystemByte
需要解密的字符串

Return Value

Type: String
解密后的内容
See Also

Reference

RSACryption Class
RSADecrypt Overload
Masuit.Tools.Security Namespace


RSACryption.RSADecrypt Method (String, String)

RSACryptionRSADecrypt Method (String, String)
RSA的解密函数 string

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string RSADecrypt(
    string xmlPrivateKey,
    string m_strDecryptString
)

Parameters

xmlPrivateKey
Type: SystemString
私钥
m_strDecryptString
Type: SystemString
需要解密的字符串

Return Value

Type: String
解密后的内容
See Also

Reference

RSACryption Class
RSADecrypt Overload
Masuit.Tools.Security Namespace


RSACryption.RSAEncrypt Method

RSACryptionRSAEncrypt Method
Overload List
 | Name | Description
Public method | RSAEncrypt(String, Byte) | RSA的加密函数 byte[]
Public method | RSAEncrypt(String, String) | RSA的加密函数 string
Top
See Also

Reference

RSACryption Class
Masuit.Tools.Security Namespace


RSACryption.RSAEncrypt Method (String, Byte[])

RSACryptionRSAEncrypt Method (String, Byte)
RSA的加密函数 byte[]

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string RSAEncrypt(
    string xmlPublicKey,
    byte[] EncryptString
)

Parameters

xmlPublicKey
Type: SystemString
公钥
EncryptString
Type: SystemByte
需要加密的字节数组

Return Value

Type: String
加密后的内容
See Also

Reference

RSACryption Class
RSAEncrypt Overload
Masuit.Tools.Security Namespace


RSACryption.RSAEncrypt Method (String, String)

RSACryptionRSAEncrypt Method (String, String)
RSA的加密函数 string

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string RSAEncrypt(
    string mStrEncryptString,
    string xmlPublicKey
)

Parameters

mStrEncryptString
Type: SystemString
需要加密的字符串
xmlPublicKey
Type: SystemString
公钥

Return Value

Type: String
加密后的内容
See Also

Reference

RSACryption Class
RSAEncrypt Overload
Masuit.Tools.Security Namespace


RSACryption.RSAKey Method

RSACryptionRSAKey Method
RSA 的密钥产生 产生私钥 和公钥

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public void RSAKey(
    out string xmlKeys,
    out string xmlPublicKey
)

Parameters

xmlKeys
Type: SystemString
私钥
xmlPublicKey
Type: SystemString
公钥
See Also

Reference

RSACryption Class
Masuit.Tools.Security Namespace


RSACryption.SignatureDeformatter Method

RSACryptionSignatureDeformatter Method
Overload List
 | Name | Description
Public method | SignatureDeformatter(String, Byte, Byte) | RSA 签名验证
Public method | SignatureDeformatter(String, Byte, String) | RSA 签名验证
Public method | SignatureDeformatter(String, String, Byte) | RSA 签名验证
Public method | SignatureDeformatter(String, String, String) | RSA 签名验证
Top
See Also

Reference

RSACryption Class
Masuit.Tools.Security Namespace


RSACryption.SignatureDeformatter Method (String, Byte[], Byte[])

RSACryptionSignatureDeformatter Method (String, Byte, Byte)
RSA 签名验证

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool SignatureDeformatter(
    string p_strKeyPublic,
    byte[] HashbyteDeformatter,
    byte[] DeformatterData
)

Parameters

p_strKeyPublic
Type: SystemString
公钥
HashbyteDeformatter
Type: SystemByte
哈希字节数据
DeformatterData
Type: SystemByte
格式字节数据

Return Value

Type: Boolean
处理结果
See Also

Reference

RSACryption Class
SignatureDeformatter Overload
Masuit.Tools.Security Namespace


RSACryption.SignatureDeformatter Method (String, Byte[], String)

RSACryptionSignatureDeformatter Method (String, Byte, String)
RSA 签名验证

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool SignatureDeformatter(
    string p_strKeyPublic,
    byte[] HashbyteDeformatter,
    string p_strDeformatterData
)

Parameters

p_strKeyPublic
Type: SystemString
公钥
HashbyteDeformatter
Type: SystemByte
哈希字节数据
p_strDeformatterData
Type: SystemString
格式字符串数据

Return Value

Type: Boolean
处理结果
See Also

Reference

RSACryption Class
SignatureDeformatter Overload
Masuit.Tools.Security Namespace


RSACryption.SignatureDeformatter Method (String, String, Byte[])

RSACryptionSignatureDeformatter Method (String, String, Byte)
RSA 签名验证

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool SignatureDeformatter(
    string p_strKeyPublic,
    string p_strHashbyteDeformatter,
    byte[] DeformatterData
)

Parameters

p_strKeyPublic
Type: SystemString
公钥
p_strHashbyteDeformatter
Type: SystemString
哈希字符串数据
DeformatterData
Type: SystemByte
格式字节数据

Return Value

Type: Boolean
处理结果
See Also

Reference

RSACryption Class
SignatureDeformatter Overload
Masuit.Tools.Security Namespace


RSACryption.SignatureDeformatter Method (String, String, String)

RSACryptionSignatureDeformatter Method (String, String, String)
RSA 签名验证

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool SignatureDeformatter(
    string p_strKeyPublic,
    string p_strHashbyteDeformatter,
    string p_strDeformatterData
)

Parameters

p_strKeyPublic
Type: SystemString
公钥
p_strHashbyteDeformatter
Type: SystemString
哈希字符串数据
p_strDeformatterData
Type: SystemString
格式字符串数据

Return Value

Type: Boolean
处理结果
See Also

Reference

RSACryption Class
SignatureDeformatter Overload
Masuit.Tools.Security Namespace


RSACryption.SignatureFormatter Method

RSACryptionSignatureFormatter Method
Overload List
 | Name | Description
Public method | SignatureFormatter(String, Byte, Byte) | RSA签名
Public method | SignatureFormatter(String, Byte, String) | RSA签名
Public method | SignatureFormatter(String, String, Byte) | RSA签名
Public method | SignatureFormatter(String, String, String) | RSA签名
Top
See Also

Reference

RSACryption Class
Masuit.Tools.Security Namespace


RSACryption.SignatureFormatter Method (String, Byte[], Byte[])

RSACryptionSignatureFormatter Method (String, Byte, Byte)
RSA签名

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool SignatureFormatter(
    string p_strKeyPrivate,
    byte[] HashbyteSignature,
    ref byte[] EncryptedSignatureData
)

Parameters

p_strKeyPrivate
Type: SystemString
私钥
HashbyteSignature
Type: SystemByte
签名字节数据
EncryptedSignatureData
Type: SystemByte
加密字节数据

Return Value

Type: Boolean
处理结果
See Also

Reference

RSACryption Class
SignatureFormatter Overload
Masuit.Tools.Security Namespace


RSACryption.SignatureFormatter Method (String, Byte[], String)

RSACryptionSignatureFormatter Method (String, Byte, String)
RSA签名

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool SignatureFormatter(
    string p_strKeyPrivate,
    byte[] HashbyteSignature,
    ref string m_strEncryptedSignatureData
)

Parameters

p_strKeyPrivate
Type: SystemString
私钥
HashbyteSignature
Type: SystemByte
签名字节数据
m_strEncryptedSignatureData
Type: SystemString
加密字符串数据

Return Value

Type: Boolean
处理结果
See Also

Reference

RSACryption Class
SignatureFormatter Overload
Masuit.Tools.Security Namespace


RSACryption.SignatureFormatter Method (String, String, Byte[])

RSACryptionSignatureFormatter Method (String, String, Byte)
RSA签名

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool SignatureFormatter(
    string p_strKeyPrivate,
    string m_strHashbyteSignature,
    ref byte[] EncryptedSignatureData
)

Parameters

p_strKeyPrivate
Type: SystemString
私钥
m_strHashbyteSignature
Type: SystemString
签名字符串数据
EncryptedSignatureData
Type: SystemByte
加密字节数据

Return Value

Type: Boolean
处理结果
See Also

Reference

RSACryption Class
SignatureFormatter Overload
Masuit.Tools.Security Namespace


RSACryption.SignatureFormatter Method (String, String, String)

RSACryptionSignatureFormatter Method (String, String, String)
RSA签名

Namespace: Masuit.Tools.Security
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public bool SignatureFormatter(
    string p_strKeyPrivate,
    string m_strHashbyteSignature,
    ref string m_strEncryptedSignatureData
)

Parameters

p_strKeyPrivate
Type: SystemString
私钥
m_strHashbyteSignature
Type: SystemString
签名字符串数据
m_strEncryptedSignatureData
Type: SystemString
加密字符串数据

Return Value

Type: Boolean
处理结果
See Also

Reference

RSACryption Class
SignatureFormatter Overload
Masuit.Tools.Security Namespace


Masuit.Tools.Strings Namespace

Masuit.Tools.Strings Namespace

[Missing <summary> documentation for "N:Masuit.Tools.Strings"]

Classes
 | Class | Description
Public class | StringExt | 字符串扩展类
Public class | ValidateCode | 画验证码


StringExt Class

StringExt Class
字符串扩展类
Inheritance Hierarchy
SystemObject
Masuit.Tools.StringsStringExt

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class StringExt

The StringExt type exposes the following members.

Methods
Name Description
Contains
检测字符串中是否包含列表中的关键词
ConvertToSecurityHtml
生成安全的html代码
DoubleToInt32
将double转换成int
HtmltoUBB
Html转UBB
MatchEmail
匹配Email
MatchIdentifyCard
根据GB11643-1999标准权威校验中国身份证号码的合法性
MatchInetAddress
校验IP地址的正确性，同时支持IPv4和IPv6
MatchPhoneNumber
匹配手机号码
MatchUrl
匹配完整格式的URL，支持以下格式的URL,支持中文域名：
支持不带协议名的网址，支持自适应协议的网址，支持完整路径，支持查询参数，支持锚点，支持锚点查询参数，支持16进制编码
www.baidu.com
www.baidu.com
baidu.com
//www.baidu.com
http://www.baidu.com
https://www.baidu.com
https://baidu.com
ftp://baidu.com
ftp://baidu.com/abc/def
ftp://admin:123456@baidu.com
ftp://admin:123456@baidu.com/abc/def
https://baidu.com:8080
https://baidu.com/abc/def
https://baidu.com:8080/abc/def
https://baidu.com:8080/abc/def/hhh.html
https://baidu.com:8080/abc/def/hhh.html?s=www
https://baidu.com/abc/def/hhh.html?s=w@w{w}!s
https://baidu.com:8080/abc/def/hhh.html?s=www&x=yy+y
https://baidu.com/abc/def/hhh.html?s=www&x=yyy
https://baidu.com:8080/abc/def/hhh.html?s=www&x=yyy#top
https://baidu.com:8080/abc/def/hi_jk-mn%ADF%AA/hhh.html?s=www&x=yyy#top
https://baidu.com:8080/abc/def/hi_j+k-mn%ADF%AA?s=www&x=yyy#top/aaa
https://baidu.com:8080/abc/def/hi_jk-mn%ADF%AA?s=www&x=yyy#top/aaa/bbb/ccc
http://music.163.com/#/my/m/music/empty
http://music.163.com/abc/#/my/m/music/empty
http://music.163.com/def/hhh.html?s=www&x=yyy#/my/m/music/empty
http://music.163.com/def/hhh.html?s=www&x=yyy/#/my/m/music/empty
http://music.163.com/#/search/m/?%23%2Fmy%2Fm%2Fmusic%2Fempty=&s=fade&type=1!k
ToDouble
字符串转double
ToInt32
字符串转int
UbbToHtml
UBB代码处理函数
UbbToHtml2
UBB转HTML方式2
Top
See Also

Reference

Masuit.Tools.Strings Namespace


StringExt Methods

StringExt Methods

The StringExt type exposes the following members.

Methods
Name Description
Contains
检测字符串中是否包含列表中的关键词
ConvertToSecurityHtml
生成安全的html代码
DoubleToInt32
将double转换成int
HtmltoUBB
Html转UBB
MatchEmail
匹配Email
MatchIdentifyCard
根据GB11643-1999标准权威校验中国身份证号码的合法性
MatchInetAddress
校验IP地址的正确性，同时支持IPv4和IPv6
MatchPhoneNumber
匹配手机号码
MatchUrl
匹配完整格式的URL，支持以下格式的URL,支持中文域名：
支持不带协议名的网址，支持自适应协议的网址，支持完整路径，支持查询参数，支持锚点，支持锚点查询参数，支持16进制编码
www.baidu.com
www.baidu.com
baidu.com
//www.baidu.com
http://www.baidu.com
https://www.baidu.com
https://baidu.com
ftp://baidu.com
ftp://baidu.com/abc/def
ftp://admin:123456@baidu.com
ftp://admin:123456@baidu.com/abc/def
https://baidu.com:8080
https://baidu.com/abc/def
https://baidu.com:8080/abc/def
https://baidu.com:8080/abc/def/hhh.html
https://baidu.com:8080/abc/def/hhh.html?s=www
https://baidu.com/abc/def/hhh.html?s=w@w{w}!s
https://baidu.com:8080/abc/def/hhh.html?s=www&x=yy+y
https://baidu.com/abc/def/hhh.html?s=www&x=yyy
https://baidu.com:8080/abc/def/hhh.html?s=www&x=yyy#top
https://baidu.com:8080/abc/def/hi_jk-mn%ADF%AA/hhh.html?s=www&x=yyy#top
https://baidu.com:8080/abc/def/hi_j+k-mn%ADF%AA?s=www&x=yyy#top/aaa
https://baidu.com:8080/abc/def/hi_jk-mn%ADF%AA?s=www&x=yyy#top/aaa/bbb/ccc
http://music.163.com/#/my/m/music/empty
http://music.163.com/abc/#/my/m/music/empty
http://music.163.com/def/hhh.html?s=www&x=yyy#/my/m/music/empty
http://music.163.com/def/hhh.html?s=www&x=yyy/#/my/m/music/empty
http://music.163.com/#/search/m/?%23%2Fmy%2Fm%2Fmusic%2Fempty=&s=fade&type=1!k
ToDouble
字符串转double
ToInt32
字符串转int
UbbToHtml
UBB代码处理函数
UbbToHtml2
UBB转HTML方式2
Top
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.Contains Method

StringExtContains Method
检测字符串中是否包含列表中的关键词

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool Contains(
    this string s,
    string[] keys
)

Parameters

s
Type: SystemString
源字符串
keys
Type: SystemString
关键词列表

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Masuit.Tools.Strings.StringExt.Contains(System.String,System.String[])"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.ConvertToSecurityHtml Method

StringExtConvertToSecurityHtml Method
生成安全的html代码

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string ConvertToSecurityHtml(
    this string html
)

Parameters

html
Type: SystemString
源html

Return Value

Type: String
安全化后的html

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.DoubleToInt32 Method

StringExtDoubleToInt32 Method
将double转换成int

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int DoubleToInt32(
    this double num
)

Parameters

num
Type: SystemDouble
double类型

Return Value

Type: Int32
int类型

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Double. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.HtmltoUBB Method

StringExtHtmltoUBB Method
Html转UBB

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string HtmltoUBB(
    this string chr
)

Parameters

chr
Type: SystemString
HTML代码

Return Value

Type: String
UBB代码

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.MatchEmail Method

StringExtMatchEmail Method
匹配Email

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Match MatchEmail(
    this string s,
    out bool isMatch
)

Parameters

s
Type: SystemString
源字符串
isMatch
Type: SystemBoolean
是否匹配成功，若返回true，则会得到一个Match对象，否则为null

Return Value

Type: Match
匹配对象

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.MatchIdentifyCard Method

StringExtMatchIdentifyCard Method
根据GB11643-1999标准权威校验中国身份证号码的合法性

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static bool MatchIdentifyCard(
    this string s
)

Parameters

s
Type: SystemString
源字符串

Return Value

Type: Boolean
是否匹配成功

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.MatchInetAddress Method

StringExtMatchInetAddress Method
校验IP地址的正确性，同时支持IPv4和IPv6

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Match MatchInetAddress(
    this string s,
    out bool isMatch
)

Parameters

s
Type: SystemString
源字符串
isMatch
Type: SystemBoolean
是否匹配成功，若返回true，则会得到一个Match对象，否则为null

Return Value

Type: Match
匹配对象

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.MatchPhoneNumber Method

StringExtMatchPhoneNumber Method
匹配手机号码

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Match MatchPhoneNumber(
    this string s,
    out bool isMatch
)

Parameters

s
Type: SystemString
源字符串
isMatch
Type: SystemBoolean
是否匹配成功，若返回true，则会得到一个Match对象，否则为null

Return Value

Type: Match
匹配对象

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.MatchUrl Method

StringExtMatchUrl Method
匹配完整格式的URL，支持以下格式的URL,支持中文域名：
支持不带协议名的网址，支持自适应协议的网址，支持完整路径，支持查询参数，支持锚点，支持锚点查询参数，支持16进制编码
www.baidu.com
www.baidu.com
baidu.com
//www.baidu.com
http://www.baidu.com
https://www.baidu.com
https://baidu.com
ftp://baidu.com
ftp://baidu.com/abc/def
ftp://admin:123456@baidu.com
ftp://admin:123456@baidu.com/abc/def
https://baidu.com:8080
https://baidu.com/abc/def
https://baidu.com:8080/abc/def
https://baidu.com:8080/abc/def/hhh.html
https://baidu.com:8080/abc/def/hhh.html?s=www
https://baidu.com/abc/def/hhh.html?s=w@w{w}!s
https://baidu.com:8080/abc/def/hhh.html?s=www&x=yy+y
https://baidu.com/abc/def/hhh.html?s=www&x=yyy
https://baidu.com:8080/abc/def/hhh.html?s=www&x=yyy#top
https://baidu.com:8080/abc/def/hi_jk-mn%ADF%AA/hhh.html?s=www&x=yyy#top
https://baidu.com:8080/abc/def/hi_j+k-mn%ADF%AA?s=www&x=yyy#top/aaa
https://baidu.com:8080/abc/def/hi_jk-mn%ADF%AA?s=www&x=yyy#top/aaa/bbb/ccc
http://music.163.com/#/my/m/music/empty
http://music.163.com/abc/#/my/m/music/empty
http://music.163.com/def/hhh.html?s=www&x=yyy#/my/m/music/empty
http://music.163.com/def/hhh.html?s=www&x=yyy/#/my/m/music/empty
http://music.163.com/#/search/m/?%23%2Fmy%2Fm%2Fmusic%2Fempty=&s=fade&type=1!k

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static Match MatchUrl(
    this string s,
    out bool isMatch
)

Parameters

s
Type: SystemString
源字符串
isMatch
Type: SystemBoolean
是否匹配成功，若返回true，则会得到一个Match对象，否则为null

Return Value

Type: Match
匹配对象

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.ToDouble Method

StringExtToDouble Method
字符串转double

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static double ToDouble(
    this string s
)

Parameters

s
Type: SystemString
源字符串

Return Value

Type: Double
double类型的数据

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.ToInt32 Method

StringExtToInt32 Method
字符串转int

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int ToInt32(
    this string s
)

Parameters

s
Type: SystemString
源字符串

Return Value

Type: Int32
int类型的数字

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.UbbToHtml Method

StringExtUbbToHtml Method
UBB代码处理函数

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string UbbToHtml(
    this string ubbStr
)

Parameters

ubbStr
Type: SystemString
输入UBB字符串

Return Value

Type: String
输出html字符串

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


StringExt.UbbToHtml2 Method

StringExtUbbToHtml2 Method
UBB转HTML方式2

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string UbbToHtml2(
    this string ubbStr
)

Parameters

ubbStr
Type: SystemString
UBB 代码

Return Value

Type: String
HTML代码

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

StringExt Class
Masuit.Tools.Strings Namespace


ValidateCode Class

ValidateCode Class
画验证码
Inheritance Hierarchy
SystemObject
Masuit.Tools.StringsValidateCode

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class ValidateCode

The ValidateCode type exposes the following members.

Methods
Name | Description
CreateValidateCode | 生成验证码
CreateValidateGraphic | 创建验证码的图片
Top
See Also

Reference

Masuit.Tools.Strings Namespace


ValidateCode Methods

ValidateCode Methods

The ValidateCode type exposes the following members.

Methods
Name | Description
CreateValidateCode | 生成验证码
CreateValidateGraphic | 创建验证码的图片
Top
See Also

Reference

ValidateCode Class
Masuit.Tools.Strings Namespace


ValidateCode.CreateValidateCode Method

ValidateCodeCreateValidateCode Method
生成验证码

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string CreateValidateCode(
    int length
)

Parameters

length
Type: SystemInt32
指定验证码的长度

Return Value

Type: String
验证码字符串
See Also

Reference

ValidateCode Class
Masuit.Tools.Strings Namespace


ValidateCode.CreateValidateGraphic Method

ValidateCodeCreateValidateGraphic Method
创建验证码的图片

Namespace: Masuit.Tools.Strings
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void CreateValidateGraphic(
    this HttpContext context,
    string validateCode,
    int fontSize = 22,
    int lineHeight = 36
)

Parameters

context
Type: System.WebHttpContext
当前的HttpContext上下文对象
validateCode
Type: SystemString
验证码序列
fontSize (Optional)
Type: SystemInt32
字体大小，默认值22px
lineHeight (Optional)
Type: SystemInt32
行高，默认36px

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HttpContext. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
Exception | Condition
Exception | The operation failed.
HttpException | The Web application is running under IIS 7 in Integrated mode.
See Also

Reference

ValidateCode Class
Masuit.Tools.Strings Namespace


Masuit.Tools.Win32 Namespace

Masuit.Tools.Win32 Namespace

[Missing <summary> documentation for "N:Masuit.Tools.Win32"]

Classes
 | Class | Description
Public class | Windows | Windows系统的系列方法
Public class | WindowsCommand | 命令提示符
Public class | WindowsServer | 服务器信息


Windows Class

Windows Class
Windows系统的系列方法
Inheritance Hierarchy
SystemObject
Masuit.Tools.Win32Windows

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class Windows

The Windows type exposes the following members.

Constructors
 | Name | Description
Public method | Windows | Initializes a new instance of the Windows class
Top
Methods
 | Name | Description
 | ClearMemory | 清理系统内存，返回优化内存后的内存占用率
 | ClearMemorySilent | 静默清理系统内存
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

Masuit.Tools.Win32 Namespace


Windows Constructor

Windows Constructor
Initializes a new instance of the Windows class

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public Windows()
See Also

Reference

Windows Class
Masuit.Tools.Win32 Namespace


Windows Methods

Windows Methods

The Windows type exposes the following members.

Methods
 | Name | Description
 | ClearMemory | 清理系统内存，返回优化内存后的内存占用率
 | ClearMemorySilent | 静默清理系统内存
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
Public method | GetHashCode | (Inherited from Object.)
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

Windows Class
Masuit.Tools.Win32 Namespace


Windows.ClearMemory Method

WindowsClearMemory Method
清理系统内存，返回优化内存后的内存占用率

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static double ClearMemory()

Return Value

Type: Double
优化内存后的内存占用率
See Also

Reference

Windows Class
Masuit.Tools.Win32 Namespace


Windows.ClearMemorySilent Method

WindowsClearMemorySilent Method
静默清理系统内存

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static void ClearMemorySilent()
See Also

Reference

Windows Class
Masuit.Tools.Win32 Namespace


WindowsCommand Class

WindowsCommand Class
命令提示符
Inheritance Hierarchy
SystemObject
Masuit.Tools.Win32WindowsCommand

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static class WindowsCommand

The WindowsCommand type exposes the following members.

Methods
Name | Description
Execute | 执行一个控制台程序，并获取在控制台返回的数据
StrictNext | 生成真正的随机数
Top
See Also

Reference

Masuit.Tools.Win32 Namespace


WindowsCommand Methods

WindowsCommand Methods

The WindowsCommand type exposes the following members.

Methods
Name | Description
Execute | 执行一个控制台程序，并获取在控制台返回的数据
StrictNext | 生成真正的随机数
Top
See Also

Reference

WindowsCommand Class
Masuit.Tools.Win32 Namespace


WindowsCommand.Execute Method

WindowsCommandExecute Method
执行一个控制台程序，并获取在控制台返回的数据

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string Execute(
    string dosCommand,
    int outtime = 0
)

Parameters

dosCommand
Type: SystemString
dos/cmd命令
outtime (Optional)
Type: SystemInt32
等待执行时间毫秒值，默认不等待

Return Value

Type: String
控制台输出信息
Exceptions
Exception | Condition
SystemException | 尚未设置进程 Id，而且不存在可从其确定 Id 属性的 Handle。- 或 -没有与此 Process 对象关联的进程。- 或 -您正尝试为远程计算机上运行的进程调用 WaitForExit(Int32)。此方法仅对本地计算机上运行的进程可用。
Win32Exception | 未能访问该等待设置。
Exception | 命令参数无效，必须传入一个控制台能被cmd.exe可执行程序; 如：ping 127.0.0.1
See Also

Reference

WindowsCommand Class
Masuit.Tools.Win32 Namespace


WindowsCommand.StrictNext Method

WindowsCommandStrictNext Method
生成真正的随机数

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int StrictNext(
    this Random r,
    int seed = 2147483647
)

Parameters

r
Type: SystemRandom

[Missing <param name="r"/> documentation for "M:Masuit.Tools.Win32.WindowsCommand.StrictNext(System.Random,System.Int32)"]

seed (Optional)
Type: SystemInt32

[Missing <param name="seed"/> documentation for "M:Masuit.Tools.Win32.WindowsCommand.StrictNext(System.Random,System.Int32)"]

Return Value

Type: Int32

[Missing <returns> documentation for "M:Masuit.Tools.Win32.WindowsCommand.StrictNext(System.Random,System.Int32)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Random. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also

Reference

WindowsCommand Class
Masuit.Tools.Win32 Namespace


WindowsServer Class

WindowsServer Class
服务器信息
Inheritance Hierarchy
SystemObject
Masuit.Tools.Win32WindowsServer

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public class WindowsServer

The WindowsServer type exposes the following members.

Constructors
 | Name | Description
Public method | WindowsServer | 构造函数
Top
Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
 | GetCpuCount |
 | GetCpuMHZ |
Public method | GetHashCode | (Inherited from Object.)
 | GetSizeOfDisk |
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
Fields
 | Name | Description
Public field | ComputerName | 计算机名
Public field | CpuCount | CPU插槽数
Public field | CpuId | CPUID
Public field | CpuMhz | CPU主频
Public field | DiskId | 硬盘ID
Public field | DiskSize | 硬盘大小
Public field | IpAddress | IP地址
Public field | LoginUserName | 系统当前登录用户
Public field | MacAddress | mac地址
Public field | SystemType | 操作系统架构
Public field | TotalPhysicalMemory | 物理内存，单位MB
Top
Properties
Name | Description
Instance | 获取实例
Top
See Also

Reference

Masuit.Tools.Win32 Namespace


WindowsServer Constructor

WindowsServer Constructor
构造函数

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public WindowsServer()
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer Fields

WindowsServer Fields

The WindowsServer type exposes the following members.

Fields
 | Name | Description
Public field | ComputerName | 计算机名
Public field | CpuCount | CPU插槽数
Public field | CpuId | CPUID
Public field | CpuMhz | CPU主频
Public field | DiskId | 硬盘ID
Public field | DiskSize | 硬盘大小
Public field | IpAddress | IP地址
Public field | LoginUserName | 系统当前登录用户
Public field | MacAddress | mac地址
Public field | SystemType | 操作系统架构
Public field | TotalPhysicalMemory | 物理内存，单位MB
Top
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.ComputerName Field

WindowsServerComputerName Field
计算机名

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string ComputerName

Field Value

Type: String
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.CpuCount Field

WindowsServerCpuCount Field
CPU插槽数

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public int CpuCount

Field Value

Type: Int32
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.CpuId Field

WindowsServerCpuId Field
CPUID

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string CpuId

Field Value

Type: String
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.CpuMhz Field

WindowsServerCpuMhz Field
CPU主频

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string[] CpuMhz

Field Value

Type: String
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.DiskId Field

WindowsServerDiskId Field
硬盘ID

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string DiskId

Field Value

Type: String
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.DiskSize Field

WindowsServerDiskSize Field
硬盘大小

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string DiskSize

Field Value

Type: String
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.IpAddress Field

WindowsServerIpAddress Field
IP地址

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string IpAddress

Field Value

Type: String
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.LoginUserName Field

WindowsServerLoginUserName Field
系统当前登录用户

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string LoginUserName

Field Value

Type: String
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.MacAddress Field

WindowsServerMacAddress Field
mac地址

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string MacAddress

Field Value

Type: String
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.SystemType Field

WindowsServerSystemType Field
操作系统架构

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string SystemType

Field Value

Type: String
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.TotalPhysicalMemory Field

WindowsServerTotalPhysicalMemory Field
物理内存，单位MB

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public string TotalPhysicalMemory

Field Value

Type: String
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer Methods

WindowsServer Methods

The WindowsServer type exposes the following members.

Methods
 | Name | Description
Public method | Equals | (Inherited from Object.)
Protected method | Finalize | (Inherited from Object.)
 | GetCpuCount |
 | GetCpuMHZ |
Public method | GetHashCode | (Inherited from Object.)
 | GetSizeOfDisk |
Public method | GetType | (Inherited from Object.)
Protected method | MemberwiseClone | (Inherited from Object.)
Public method | ToString | (Inherited from Object.)
Top
Extension Methods
 | Name | Description
Public Extension Method | GetFieldT | 获取字段 (Defined by ReflectionUtil.)
Public Extension Method | GetFields | 获取所有的字段信息 (Defined by ReflectionUtil.)
Public Extension Method | GetInstanceValue | 获取实体相关属性的值 (Defined by ReflectHelper.)
Public Extension Method | GetProperties | 获取所有的属性信息 (Defined by ReflectionUtil.)
Public Extension Method | GetPropertyT | 获取属性 (Defined by ReflectionUtil.)
Public Extension Method | InvokeMethodT | 执行方法 (Defined by ReflectionUtil.)
Public Extension Method | ReferenceEquals | 严格比较两个对象是否是同一对象 (Defined by ObjectExt.)
Public Extension Method | SetField | 设置字段 (Defined by ReflectionUtil.)
Public Extension Method | SetProperty | 设置属性 (Defined by ReflectionUtil.)
Top
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.GetCpuCount Method

WindowsServerGetCpuCount Method

[Missing <summary> documentation for "M:Masuit.Tools.Win32.WindowsServer.GetCpuCount"]

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static int GetCpuCount()

Return Value

Type: Int32

[Missing <returns> documentation for "M:Masuit.Tools.Win32.WindowsServer.GetCpuCount"]

See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.GetCpuMHZ Method

WindowsServerGetCpuMHZ Method

[Missing <summary> documentation for "M:Masuit.Tools.Win32.WindowsServer.GetCpuMHZ"]

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string[] GetCpuMHZ()

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Win32.WindowsServer.GetCpuMHZ"]

See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.GetSizeOfDisk Method

WindowsServerGetSizeOfDisk Method

[Missing <summary> documentation for "M:Masuit.Tools.Win32.WindowsServer.GetSizeOfDisk"]

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static string GetSizeOfDisk()

Return Value

Type: String

[Missing <returns> documentation for "M:Masuit.Tools.Win32.WindowsServer.GetSizeOfDisk"]

See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer Properties

WindowsServer Properties

The WindowsServer type exposes the following members.

Properties
Name | Description
Instance | 获取实例
Top
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace


WindowsServer.Instance Property

WindowsServerInstance Property
获取实例

Namespace: Masuit.Tools.Win32
Assembly: Masuit.Tools (in Masuit.Tools.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
Copy
public static WindowsServer Instance { get; }

Property Value

Type: WindowsServer
See Also

Reference

WindowsServer Class
Masuit.Tools.Win32 Namespace