1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace IMCS_CCS.Utils
- {
- public class ToolUtils
- {
- public static string AddressConvertDBW(string Address)
- {
- string[] sArray = Address.Split('.');
- return sArray[0] + ".DBW" + sArray[1];
- }
- public static byte[] ReturnBtyesWtitString(string value, int byteleng = 30)
- {
- byte[] bt = new byte[byteleng];
- byte[] item = Encoding.Default.GetBytes(value.Clone().ToString());
- Array.Copy(item, bt, item.Length);
- return bt;
- }
- public static string ReturnStringByBytes(byte[] value)
- {
- return System.Text.Encoding.Default.GetString(value).Replace("\0", "");
- }
- }
- }
|