当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: office xp 不知道按了什么,无论是打开文档,还是新建文档,也不能修改也不能打字,一操作就出现如下提示: 无法使用此命令。因为此文档已经锁定,不可编辑 在视图工具栏中“大纲”颜色是灰色的,不能点。如何解决???? 在线等待,解决即结帖。 ......
 ·一个简单的问题    »显示摘要«
    摘要: 我的asp页上有一个文本框,是用来显示流水号的。我想一打开这个asp页流水号就显示在文本框内,怎样实现?为什么用文本框显示时间用初始值=<%=now%>就可以,但用文本框显示流水号用初始值=<%=serianum%>就不能显示(serianum是变量)? ......


如何把写入image数据类型的doc、jpeg、text文件读出,并显示在网页上(

如何把写入image数据类型的doc、jpeg、text文件读出,并显示在网页上?

Try  
                                                  Dim   filename   As   String  
                                                  Dim   fileType   As   String  
                                                  Dim   fileSize   As   String  
                                                  Dim   fileDataCol   As   Int32   =   4  
                                                  Dim   execCommand   As   SqlCommand   =   New   SqlCommand()  
                                                  Dim   fs   As   System.IO.FileStream  
                                                    Dim   file   As   System.IO.FileInfo  
   
                                                  With   execCommand  
                                                          .CommandText   =   "PubS_GetAccessoriesByNoid"  
                                                          .Connection   =   New   SqlConnection(OA.Common.OAConfiguration.ConnectionString)  
                                                          .CommandType   =   CommandType.StoredProcedure  
   
                                                          .Parameters.Add(New   SqlParameter("@noid",   SqlDbType.Int)).Value   =   noid  
   
                                                          .Connection.Open()  
                                                          Dim   dr   As   SqlDataReader   =   .ExecuteReader()  
                                                          dr.Read()  
                                                          Dim   b(CType(dr.GetBytes(fileDataCol,   0,   Nothing,   0,   Int32.MaxValue),   Int32))   As   Byte  
                                                          dr.GetBytes(fileDataCol,   0,   b,   0,   b.Length)  
                                                          fileType   =   dr.GetString(2)  
                                                          fileSize   =   b.Length.ToString  
                                                          filename   =   dr.GetString(1)  
                                                          dr.Close()  
                                                          .Connection.Close()  
   
   
                                                          HttpContext.Current.Response.Clear()  
                                                          Response.ContentType   =   fileType  
                                                          Response.Clear()  
                                                          Response.AddHeader("Content-Length",   fileSize)  
                                                          Response.AddHeader("Content-Disposition",   "inline;filename="   &   filename)  
                                                          Response.OutputStream.Write(b,   0,   b.Length)  
                                                  End   With  
                                          Catch   ex   As   SqlException  
   
                                          End   Try  
                                          Me.Response.End()

NO.2   作者: webdiyer

Displaying   Images   that   Reside   in   a   Database    
  http://www.4guysfromrolla.com/webtech/060100-1.shtml  
 


    摘要: 如题。 ......
» 本期热门文章:
· 热门栏目:
» 相关精选文章
» 其它相关:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE