SQL数据库二进制数如何转换
网站后台密码忘记了,进入数据库后找到管理员账户,但是密码是二进制数加密的。怎么转换啊?另外怎么查看密码呢?...
网站后台密码忘记了,进入数据库后找到管理员账户,但是密码是二进制数加密的。怎么转换啊?另外怎么查看密码呢?
展开
1个回答
展开全部
C# 保存
openFileDialog1.Filter = "*jpg|*.JPG|*.GIF|*.GIF|*.BMP|*.BMP"; if(openFileDialog1.ShowDialog()==DialogResult.OK) {
string fullpath =openFileDialog1.FileName;//文件路径 FileStream fs = new FileStream(fullpath, FileMode.Open); byte[] imagebytes =new byte[fs.Length]; BinaryReader br = new BinaryReader(fs);
imagebytes = br.ReadBytes(Convert.ToInt32(fs.Length)); //打开数据库
SqlConnection con = new
SqlConnection("server=(local);uid=sa;pwd=;database=test"); con.Open();
SqlCommand com = new SqlCommand("insert into tb_08 values(@ImageList)",con);
com.Parameters.Add("ImageList", SqlDbType.Image); com.Parameters["ImageList"].Value = imagebytes; com.ExecuteNonQuery(); con.Close();
openFileDialog1.Filter = "*jpg|*.JPG|*.GIF|*.GIF|*.BMP|*.BMP"; if(openFileDialog1.ShowDialog()==DialogResult.OK) {
string fullpath =openFileDialog1.FileName;//文件路径 FileStream fs = new FileStream(fullpath, FileMode.Open); byte[] imagebytes =new byte[fs.Length]; BinaryReader br = new BinaryReader(fs);
imagebytes = br.ReadBytes(Convert.ToInt32(fs.Length)); //打开数据库
SqlConnection con = new
SqlConnection("server=(local);uid=sa;pwd=;database=test"); con.Open();
SqlCommand com = new SqlCommand("insert into tb_08 values(@ImageList)",con);
com.Parameters.Add("ImageList", SqlDbType.Image); com.Parameters["ImageList"].Value = imagebytes; com.ExecuteNonQuery(); con.Close();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询