HslExtension 类 |
命名空间: HslCommunication
HslExtension 类型公开以下成员。
名称 | 说明 | |
---|---|---|
BeginReceiveResult(Socket, AsyncCallback) |
启动接收数据,需要传入回调方法,传递对象默认为socket本身 To start receiving data, you need to pass in a callback method. The default object is the socket itself. | |
BeginReceiveResult(Socket, AsyncCallback, Object) |
启动接收数据,需要传入回调方法,传递对象 To start receiving data, you need to pass in a callback method and pass an object | |
Contains | Returns a value indicating whether a specified substring occurs within this string. | |
CopyArrayT |
拷贝当前的实例数组,是基于引用层的浅拷贝,如果类型为值类型,那就是深度拷贝,如果类型为引用类型,就是浅拷贝
| |
DecryptLargeData |
对超过117字节限制的加密数据进行解密,解密出原始的字节数据,因为RSA本身限制了117字节,所以此处进行数据切割解密。 Decrypt the encrypted data that exceeds the 117-byte limit and decrypt the original byte data, because RSA itself limits 117 bytes, so the data is cut and decrypted here. | |
EncryptLargeData |
对原始字节的数据进行加密,不限制长度,因为RSA本身限制了117字节,所以此处进行数据切割加密。 Encrypt the original byte data without limiting the length, because RSA itself limits 117 bytes, so the data is cut and encrypted here. | |
EndReceiveResult |
结束挂起的异步读取,返回读取的字节数,如果成功的情况。 Ends the pending asynchronous read and returns the number of bytes read, if successful. | |
EndsWith | Determines whether the end of this string instance matches the specified string. | |
EveryByteAdd |
将指定的数据添加到数组的每个元素上去,会改变每个元素的值
| |
GetBoolByIndex(Byte, Int32) |
获取Byte的第 boolIndex 偏移的bool值,比如3,就是第4位 Get the bool value of Byte's boolIndex offset, such as 3, which is the 4th bit | |
GetBoolByIndex(Byte, Int32) |
获取Byte数组的第 boolIndex 偏移的bool值,这个偏移值可以为 10,就是第 1 个字节的 第3位 Get the bool value of the boolIndex offset of the Byte array. The offset value can be 10, which is the third bit of the first byte | |
GetBoolByIndex(Int16, Int32) |
获取short类型数据的第 boolIndex (从0起始)偏移的bool值,比如3,就是第4位 Get the bool value of the boolIndex (starting from 0) offset of the short type data, such as 3, which is the 4th bit | |
GetBoolByIndex(Int32, Int32) |
获取int类型数据的第 boolIndex (从0起始)偏移的bool值,比如3,就是第4位 Get the bool value of the boolIndex (starting from 0) offset of the int type data, such as 3, which is the 4th bit | |
GetBoolByIndex(Int64, Int32) |
获取long类型数据的第 boolIndex (从0起始)偏移的bool值,比如3,就是第4位 Get the bool value of the boolIndex (starting from 0) offset of the long type data, such as 3, which is the 4th bit | |
GetBoolByIndex(UInt16, Int32) |
获取ushort类型数据的第 boolIndex (从0起始)偏移的bool值,比如3,就是第4位 Get the bool value of the boolIndex (starting from 0) offset of the ushort type data, such as 3, which is the 4th bit | |
GetBoolByIndex(UInt32, Int32) |
获取uint类型数据的第 boolIndex (从0起始)偏移的bool值,比如3,就是第4位 Get the bool value of the boolIndex (starting from 0) offset of the uint type data, such as 3, which is the 4th bit | |
GetBoolByIndex(UInt64, Int32) |
获取ulong类型数据的第 boolIndex (从0起始)偏移的bool值,比如3,就是第4位 Get the bool value of the boolIndex (starting from 0) offset of the ulong type data, such as 3, which is the 4th bit | |
GetBoolValue |
获取Byte数组的第 bytIndex 个位置的,boolIndex偏移的bool值 Get the bool value of the bytIndex position of the Byte array and the boolIndex offset | |
GetBytes |
根据指定的字节长度信息,获取到随机的字节信息 Obtain random byte information according to the specified byte length information | |
GetPEMPrivateKey |
从RSA的算法对象里,获取到PEM格式的原始私钥数据,如果需要存储,或是显示,只需要 Convert.ToBase64String 方法 Obtain the original private key data in PEM format from the RSA algorithm object. If you need to store or display it, you only need the Convert.ToBase64String method | |
GetPEMPublicKey |
从RSA的算法对象里,获取到PEM格式的原始公钥数据,如果需要存储,或是显示,只需要 Convert.ToBase64String 方法 Obtain the original public key data in PEM format from the RSA algorithm object. If you need to store or display it, you only need the Convert.ToBase64String method | |
GetStringOrEndChar |
从字节数组里提取字符串数据,如果碰到0x00字节,就直接结束
| |
GetValueOrDefaultT |
一个泛型方法,提供json对象的数据读取 A generic method that provides data read for a JSON object | |
IncreaseByT |
将指定的数据添加到数组的每个元素上去,使用表达式树的形式实现,将会修改原数组。不适用byte类型
| |
IniSerialByFormatString |
使用格式化的串口参数信息来初始化串口的参数,举例:9600-8-N-1,分别表示波特率,数据位,奇偶校验,停止位,当然也可以携带串口名称,例如:COM3-9600-8-N-1,linux环境也是支持的。 Use the formatted serial port parameter information to initialize the serial port parameters, for example: 9600-8-N-1, which means baud rate, data bit, parity, stop bit, of course, can also carry the serial port name, for example: COM3- 9600-8-N-1, linux environment is also supported. | |
RemoveBeginT |
将一个数组的前面指定位数移除,返回新的一个数组 Removes the preceding specified number of bits in a array, returning a new array | |
RemoveDoubleT |
将一个数组的前后移除指定位数,返回新的一个数组 Removes a array before and after the specified number of bits, returning a new array | |
RemoveLast(String, Int32) |
移除指定字符串数据的最后 length 个字符。如果字符串本身的长度不足 length,则返回为空字符串。 Remove the last "length" characters of the specified string data. If the length of the string itself is less than length, an empty string is returned. | |
RemoveLastT(T, Int32) |
将一个数组的后面指定位数移除,返回新的一个数组 Removes the specified number of digits after a array, returning a new array | |
ReverseByWord |
将byte数组按照双字节进行反转,如果为单数的情况,则自动补齐 Reverses the byte array by double byte, or if the singular is the case, automatically | |
ReverseNewT |
获取当前数组的倒序数组,这是一个新的实例,不改变原来的数组值 Get the reversed array of the current byte array, this is a new instance, does not change the original array value | |
SelectBeginT |
选择一个数组的前面的几个数据信息 Select the begin few items of data information of a array | |
SelectLastT |
选择一个数组的后面的几个数据信息 Select the last few items of data information of a array | |
SelectMiddleT |
获取到数组里面的中间指定长度的数组 Get an array of the specified length in the array | |
SetBoolByIndex(Byte, Int32, Boolean) |
设置Byte的第 boolIndex 位的bool值,可以强制为 true 或是 false, 不影响其他的位 Set the bool value of the boolIndex bit of Byte, which can be forced to true or false, without affecting other bits | |
SetBoolByIndex(Byte, Int32, Boolean) |
设置Byte[]的第 boolIndex 位的bool值,可以强制为 true 或是 false, 不影响其他的位,如果是第 10 位,则表示第 1 个字节的第 2 位(都是从 0 地址开始算的) Set the bool value of the boolIndex bit of Byte[], which can be forced to true or false, without affecting other bits. If it is the 10th bit, it means the second bit of the first byte (both starting from the 0 address Calculated) | |
SetBoolByIndex(Int16, Int32, Boolean) |
修改short数据的某个位,并且返回修改后的值,不影响原来的值。位索引为 0~15,之外的值会引发异常 Modify a bit of short data and return the modified value without affecting the original value. Bit index is 0~15, values outside will raise an exception | |
SetBoolByIndex(Int32, Int32, Boolean) |
修改int数据的某个位,并且返回修改后的值,不影响原来的值。位索引为 0~31,之外的值会引发异常 Modify a bit of int data and return the modified value without affecting the original value. Bit index is 0~31, values outside will raise an exception | |
SetBoolByIndex(Int64, Int32, Boolean) |
修改long数据的某个位,并且返回修改后的值,不影响原来的值。位索引为 0~63,之外的值会引发异常 Modify a bit of long data and return the modified value without affecting the original value. Bit index is 0~63, values outside will raise an exception | |
SetBoolByIndex(UInt16, Int32, Boolean) |
修改ushort数据的某个位,并且返回修改后的值,不影响原来的值。位索引为 0~15,之外的值会引发异常 Modify a bit of ushort data and return the modified value without affecting the original value. Bit index is 0~15, values outside will raise an exception | |
SetBoolByIndex(UInt32, Int32, Boolean) |
修改uint数据的某个位,并且返回修改后的值,不影响原来的值。位索引为 0~31,之外的值会引发异常 Modify a bit of uint data and return the modified value without affecting the original value. Bit index is 0~31, values outside will raise an exception | |
SetBoolByIndex(UInt64, Int32, Boolean) |
修改ulong数据的某个位,并且返回修改后的值,不影响原来的值。位索引为 0~63,之外的值会引发异常 Modify a bit of ulong data and return the modified value without affecting the original value. Bit index is 0~63, values outside will raise an exception | |
SetKeepAlive |
设置套接字的活动时间和活动间歇时间,此值会设置到socket低级别的控制中,传入值如果为负数,则表示不使用 KeepAlive 功能。 Set the active time and active intermittent time of the socket. This value will be set to the low-level control of the socket. If the incoming value is a negative number, it means that the KeepAlive function is not used. | |
SpliceArrayT |
拼接任意个泛型数组为一个总的泛型数组对象,采用深度拷贝实现。 Splicing any number of generic arrays into a total generic array object is implemented using deep copy. | |
SplitDot |
根据英文小数点进行切割字符串,去除空白的字符 Cut the string according to the English decimal point and remove the blank characters | |
StartsWith | Determines whether the beginning of this string instance matches the specified string. | |
StartsWithAndNumber(String, String) |
判断一个地址是否是指定的字符串开头,并且后面跟着数字,如果是,返回 true,反之,返回 false Determines whether an address starts with a specified string followed by a number, returns true if so, and false if not | |
StartsWithAndNumber(String, String) |
判断一个地址是否是指定的字符串开头,并且后面跟着数字,如果是,返回 true,反之,返回 false Determines whether an address starts with a specified string followed by a number, returns true if so, and false if not | |
ToArrayStringT(T) |
将数组格式化为显示的字符串的信息,支持所有的类型对象 Formats the array into the displayed string information, supporting all types of objects | |
ToArrayStringT(T, String) |
将数组格式化为显示的字符串的信息,支持所有的类型对象 Formats the array into the displayed string information, supporting all types of objects | |
ToBoolArray(Byte) |
从Byte数组中提取所有的位数组 Extracts a bit array from a byte array, length represents the number of digits | |
ToBoolArray(Byte, Int32) |
从Byte数组中提取位数组,length代表位数,例如数组 03 A1 长度10转为 [1100 0000 10] Extracts a bit array from a byte array, length represents the number of digits | |
ToByteArray |
将bool数组转换到byte数组 Converting a bool array to a byte array | |
ToFormatString |
将一个串口对象的基本配置参数进行格式化字符串,例如 COM3-9600-8-N-1 Format the basic configuration parameters of a serial port object as a string, for example, COM3-9600-8-N-1 | |
ToHexBytes |
将16进制的字符串转化成Byte数据,将检测每2个字符转化,也就是说,中间可以是任意字符 Converts a 16-character string into byte data, which will detect every 2 characters converted, that is, the middle can be any character | |
ToHexString(Byte) |
字节数据转化成16进制表示的字符串 Byte data into a string of 16 binary representations | |
ToHexString(Byte, Char) |
字节数据转化成16进制表示的字符串 Byte data into a string of 16 binary representations | |
ToHexString(Byte, Char, Int32, String) |
字节数据转化成16进制表示的字符串 Byte data into a string of 16 binary representations | |
ToJsonString |
获取当前对象的JSON格式表示的字符串。 Gets the string represented by the JSON format of the current object. | |
ToStringArrayT(String) |
将字符串数组转换为实际的数据数组。支持byte,sbyte,bool,short,ushort,int,uint,long,ulong,float,double,使用默认的十进制,例如字符串格式[1,2,3,4,5],可以转成实际的数组对象 Converts a string array into an actual data array. Support byte, sbyte, bool, short, ushort, int, uint, long, ulong, float, double, use the default decimal, such as the string format [1,2,3,4,5], which can be converted into an actual array Object | |
ToStringArrayT(String, FuncString, T) |
将字符串数组转换为实际的数据数组。例如字符串格式[1,2,3,4,5],可以转成实际的数组对象 Converts a string array into an actual data array. For example, the string format [1,2,3,4,5] can be converted into an actual array object | |
Write | Writes a block of bytes to the current stream using data read from a buffer. | |
WriteReverse |
将UInt16数据写入到字节流,字节顺序为相反 Write UInt16 data to the byte stream, the byte order is reversed |