{"id":1294,"date":"2014-08-20T16:04:21","date_gmt":"2014-08-20T08:04:21","guid":{"rendered":"http:\/\/www.youthtribe.com\/?p=1294"},"modified":"2014-08-20T16:04:21","modified_gmt":"2014-08-20T08:04:21","slug":"%e3%80%90asp%e3%80%91%e5%88%a9%e7%94%a8adodb-stream%e5%af%b9%e8%b1%a1%e6%9d%a5%e8%af%bb%e5%8f%96utf-8%e6%a0%bc%e5%bc%8f%e7%9a%84%e6%96%87%e6%9c%ac%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"http:\/\/www.youthtribe.com\/archives\/1294","title":{"rendered":"\u3010asp\u3011\u5229\u7528AdoDb.Stream\u5bf9\u8c61\u6765\u8bfb\u53d6utf-8\u683c\u5f0f\u7684\u6587\u672c\u6587\u4ef6"},"content":{"rendered":"
\r\n'-------------------------------------------------\r\n'\u51fd\u6570\u540d\u79f0:ReadTextFile\r\n'\u4f5c\u7528:\u5229\u7528AdoDb.Stream\u5bf9\u8c61\u6765\u8bfb\u53d6utf-8\u683c\u5f0f\u7684\u6587\u672c\u6587\u4ef6\r\n'----------------------------------------------------\r\nfunction ReadFromTextFile (FileUrl,CharSet)\r\n    dim str\r\n    set stm=server.CreateObject(\"adodb.stream\")\r\n    stm.Type=2 '\u4ee5\u672c\u6a21\u5f0f\u8bfb\u53d6\r\n    stm.mode=3 \r\n    stm.charset=CharSet\r\n    stm.open\r\n    stm.loadfromfile server.MapPath(FileUrl)\r\n    str=stm.readtext\r\n    stm.Close\r\n    set stm=nothing\r\n    ReadFromTextFile=str\r\nend function\r\n'-------------------------------------------------\r\n'\u51fd\u6570\u540d\u79f0:WriteToTextFile\r\n'\u4f5c\u7528:\u5229\u7528AdoDb.Stream\u5bf9\u8c61\u6765\u5199\u5165utf-8\u683c\u5f0f\u7684\u6587\u672c\u6587\u4ef6\r\n'----------------------------------------------------\r\nSub WriteToTextFile (FileUrl,byval Str,CharSet)        \r\n    set stm=server.CreateObject(\"adodb.stream\")\r\n    stm.Type=2 '\u4ee5\u672c\u6a21\u5f0f\u8bfb\u53d6\r\n    stm.mode=3\r\n    stm.charset=CharSet\r\n    stm.open\r\n    stm.WriteText str\r\n    stm.SaveToFile server.MapPath(FileUrl),2    \r\n    stm.flush\r\n    stm.Close\r\n    set stm=nothing\r\nend Sub\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

‘————————————————- ‘\u51fd\u6570\u540d\u79f0:ReadTextFile ‘\u4f5c\u7528:\u5229\u7528AdoDb.Stream\u5bf9\u8c61\u6765\u8bfb\u53d6utf-8\u683c\u5f0f\u7684\u6587\u672c\u6587\u4ef6 ‘—————————————————- function ReadFromTextFile (FileUrl,CharSet) dim str set stm=server.CreateObject(“adodb.stream”) stm.Type=2 ‘\u4ee5\u672c\u6a21\u5f0f\u8bfb\u53d6 stm.mode=3 stm.charset=Ch<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,9],"tags":[],"_links":{"self":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1294"}],"collection":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/comments?post=1294"}],"version-history":[{"count":1,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1294\/revisions"}],"predecessor-version":[{"id":1295,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1294\/revisions\/1295"}],"wp:attachment":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/media?parent=1294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/categories?post=1294"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/tags?post=1294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}