小编Cat*_*ine的帖子

C#char"//"路径分隔符

是否有可能使用char"//"我做了另一个?我在Path寻找,但我找不到它.

  string separator = "//";
Run Code Online (Sandbox Code Playgroud)

我的意思是 '/'.

我用了:

static string sep = System.IO.Path.PathSeparator.ToString();
Run Code Online (Sandbox Code Playgroud)

但它返回:';'.为什么?

c# separator

14
推荐指数
2
解决办法
2万
查看次数

从int转换为十六进制

我想将一些整数转换为十六进制,但我得到的是这样的东西:"?| ??? plL4?h ?? N {"来自12345.为什么?

int t = 12345;

System.Security.Cryptography.MD5CryptoServiceProvider ano = new
System.Security.Cryptography.MD5CryptoServiceProvider();

byte[] d_ano = System.Text.Encoding.ASCII.GetBytes(t.ToString());
byte[] d_d_ano = ano.ComputeHash(d_ano);

string st_data1 = System.Text.Encoding.ASCII.GetString(d_d_ano);
string st_data = st_data1.ToString();
Run Code Online (Sandbox Code Playgroud)

我在窗口中使用它,而不是在控制台中.

c# string hex

4
推荐指数
2
解决办法
1万
查看次数

标签 统计

c# ×2

hex ×1

separator ×1

string ×1