急急急!!!winform 二进制转换成PDF文件并显示 急急!!!!分不够可再加!winform程序 将数据库中的byte[]转换成PDF文件并显示在窗体上。Adobe PDF Reader用这个控件,不知道怎么绑定byte[]. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Byte[] ByteArray = 读取的byte[];System.IO.FileStream _FileStream = new System.IO.FileStream("c:\\xxx.pdf", System.IO.FileMode.Create, System.IO.FileAccess.Write);_FileStream.Write(_ByteArray, 0, _ByteArray.Length);_FileStream.Close();显示可以使用webBrowser FileStream fs = new FileStream("", FileMode.Open);byte[] b=new byte[fs.Length];using(SqlConnection conn = new SqlConnection("")){conn.Open();string sql = "insert into Tb(file) values(@pdf)";SqlCommand cmd = new SqlCommand(sql, conn);cmd.Parameters.Add("@pdf", SqlDbType.Image,b.Length).Value =b;}using(SqlConnection conn = new SqlConnection("")){conn.Open();string strSql = "select file from Tb";SqlCommand cmd = new SqlCommand(strSql, conn);SqlDataReader dr = cmd.ExecuteReader();dr.Read();MemoryStream ms = new MemoryStream((byte[])dr[0]);} SerialPort.BytesToRead相关疑问,求大家帮忙解答? 企信通发送短信上行问题 FullTunnelControl.dll 线程池,异步的一个小问题! 弱弱的问一下:EventHandler 的相关问题 未能找到元素“compiler”的架构信息。 怎么加载其它窗体?加载后怎么实现隐藏主窗口后其它窗口也跟着隐藏? 怎么添加组件? 棘手问题,在线等 求推荐项目文档管理系统,不是用于开发团队,而是用于最终归档文件管理的 两个应用程序(exe文件),之间可以通过什么传递处理结果呢?? 如何在一个表中快速添加主键?【表中已有数据】 新手关于编程路
System.IO.FileStream _FileStream = new System.IO.FileStream("c:\\xxx.pdf", System.IO.FileMode.Create, System.IO.FileAccess.Write);
_FileStream.Write(_ByteArray, 0, _ByteArray.Length);
_FileStream.Close();显示可以使用webBrowser
byte[] b=new byte[fs.Length];
using(SqlConnection conn = new SqlConnection(""))
{
conn.Open();
string sql = "insert into Tb(file) values(@pdf)";
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.Parameters.Add("@pdf", SqlDbType.Image,b.Length).Value =b;
}using(SqlConnection conn = new SqlConnection(""))
{
conn.Open();
string strSql = "select file from Tb";
SqlCommand cmd = new SqlCommand(strSql, conn);
SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
MemoryStream ms = new MemoryStream((byte[])dr[0]);
}