由于保护级别,无法访问system.linq.strings

编程入门 行业动态 更新时间:2024-10-26 03:25:46
本文介绍了由于保护级别,无法访问system.linq.strings的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

private byte[] CreateKey(string strPassword) { //Convert strPassword to an array and store in chrData. char[] chrData = strPassword.ToCharArray(); //Use intLength to get strPassword size. int intLength = chrData.GetUpperBound(0); //Declare bytDataToHash and make it the same size as chrData. byte[] bytDataToHash = new byte[intLength + 1]; //Use For Next to convert and store chrData into bytDataToHash. for (int i = 0; i <= chrData.GetUpperBound(0); i++) { bytDataToHash[i] = Convert.ToByte(Strings.Asc(chrData[i])); }

推荐答案

类似的声音正在运行.Net网站,而无需确保已安装.Net 3.5.除此之外,更好的方法是这样的: Sounds like you''re running a .Net website without making sure .Net 3.5 is installed. Beyond that, a better way to do that is like so: bytDataToHash = Encoding.Unicode.GetBytes(strPassword);

您不需要一次做一个字符.

You don''t need to do it a character at a time.

更多推荐

由于保护级别,无法访问system.linq.strings

本文发布于:2023-11-26 20:00:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634983.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法访问   级别   system   linq   strings

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!