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

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

系統(tǒng) 2647 0

問(wèn)題:如何讀取thumbs.db里的縮略圖?

請(qǐng)先到這里下載一個(gè)控件

ThumbDBLib

A C# library for reading thumbs.db file

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

引用dll,這里提供了 VB和C#代碼,一個(gè)Thumbs.aspx,添加一個(gè)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)


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

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

【本文對(duì)您有幫助就好】

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

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 和硕县| 通州区| 元阳县| 保康县| 嘉义县| 游戏| 读书| 长武县| 丰顺县| 崇明县| 巩义市| 黄大仙区| 安庆市| 溧水县| 东方市| 岳西县| 花垣县| 梅河口市| 独山县| 搜索| 五寨县| 平昌县| 浪卡子县| 昌江| 承德县| 昌吉市| 克山县| 故城县| 扎兰屯市| 香港 | 红桥区| 合作市| 屏东县| 沙雅县| 犍为县| 章丘市| 拜泉县| 托克逊县| 邯郸县| 潮安县| 克东县|