为什么ADODB.STREAM在Internet Explorer 9中不起作用?

时间:2011-09-14 09:36:09

标签: javascript internet-explorer-9 adodb activexobject

为什么此代码在Internet Explorer 9中不起作用?

function GetFile(FileName) {
    var Contents1=null;
    var Stream;
    Stream = new ActiveXObject("ADODB.Stream")
    Stream.Type = 1 //Binary
    Stream.Open()
    Stream.LoadFromFile(FileName)
    Contents1 = Stream.Read()
    FileSize = Stream.Size
    Stream.Close()
    return Contents1;
}

1 个答案:

答案 0 :(得分:0)

 Contents1 = Stream.Read(-1); //-1 adReadAll