我正在尋找從mysql數(shù)據(jù)庫讀取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但這是我的一滴的內(nèi)容a:1:{s:4:"hash";s:60:"$2y$10$myhashishere";}
在C#MySQL中讀取mediumblob
寶慕林4294392
2021-05-11 13:12:10