我正在寻找从mysql数据库读取blob文件,并显示blob的“哈希”段。这是我尝试过的。MySqlConnection _connection = new MySqlConnection("Database=forum;Data Source=localhost;User Id=root;Password="); MySqlCommand cmd = new MySqlCommand("SELECT data FROM xf_user_authenticate WHERE user_id=1", _connection); _connection.Open(); MemoryStream ms = new MemoryStream(); FileStream fs; Byte[] bindata; bindata = (byte[])(cmd.ExecuteScalar()); ms.Write(bindata, 0, bindata.Length); API.consoleOutput($"{bindata.Length} - {bindata.ToString()}");这输出到控制台,结果是97 - 58但这是我的一滴的内容a:1:{s:4:"hash";s:60:"$2y$10$myhashishere";}
- 1 回答
- 0 关注
- 365 浏览
添加回答
举报
0/150
提交
取消