日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

如何讀取thumbs.db里的縮略圖?(downmoon)

系統 2903 0

問題:如何讀取thumbs.db里的縮略圖?

請先到這里下載一個控件

ThumbDBLib

A C# library for reading thumbs.db file

http://www.petedavis.net/MySite/DynPageView.aspx?pageid=31

引用dll,這里提供了 VB和C#代碼,一個Thumbs.aspx,添加一個ID為 plcThumbs PlaceHolder

<!-- {cps..0}-->

VB主要代碼:


<!-- {cps..1}--> Dim ThumbDb As String = Server.MapPath( " . " ) & " /thumbs.db "
If System.IO.File.Exists(ThumbDb) Then

Dim ThumbLib As New ThumbDBLib.ThumbDB(ThumbDb)

If Not Request.QueryString( " thumb " ) Is Nothing Then

Dim Thumb As String = Request.QueryString( " thumb " )
Dim ThumbData As Byte () = ThumbLib.GetThumbData(Thumb)

Response.Clear()
Response.ContentType
= " image/ " & System.IO.Path.GetExtension(Thumb).ToLower.Replace( " . " , "" )
Response.BinaryWrite(ThumbData)
Response.Flush()
Response.End()

Else

For Each thumb As String In ThumbLib.GetThumbfiles

If System.IO.File.Exists(Server.MapPath( " . " ) & " / " & thumb) Then

' CoulduseaLiteralcontrolhereifyouwantmore
' controloverthehtml.
Dim ThumbImage As New System.Web.UI.WebControls.Image

ThumbImage.ImageUrl
= " thumbs.aspx?thumb= " & Server.UrlEncode(thumb)
ThumbImage.ImageAlign
= ImageAlign.Top
ThumbImage.AlternateText
= thumb
ThumbImage.BorderStyle
= BorderStyle.Outset
ThumbImage.BorderWidth
= New Unit( 1 )
ThumbImage.Attributes.Add(
" hspace " , " 4 " )
ThumbImage.Attributes.Add(
" vspace " , " 4 " )
ThumbImage.Attributes.Add(
" onclick " , " window.location.href=' " & thumb & " '; " )
ThumbImage.Style.Add(
" cursor " , " hand " )

plcThumbs.Controls.Add(ThumbImage)

End If

Next

End If

ThumbLib
= Nothing

Else

Response.Write(
" Thumbs.dbNotFound! " )

End If

C#主要代碼:


瀏覽效果如圖:

完畢。
源碼可以在 這里 下載

如何讀取thumbs.db里的縮略圖?(downmoon)


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 淮安市| 元氏县| 翁牛特旗| 高阳县| 岱山县| 清丰县| 文登市| 新邵县| 墨玉县| 周至县| 龙门县| 赤水市| 遂溪县| 分宜县| 诸暨市| 繁昌县| 浦城县| 定州市| 乐东| 尼木县| 满城县| 安阳市| 海南省| 嘉义市| 应用必备| 上栗县| 寿阳县| 雷波县| 茶陵县| 怀柔区| 台州市| 江都市| 高安市| 衡东县| 驻马店市| 孝义市| 崇明县| 盐津县| 珠海市| 新营市| 花莲市|