vbscript / AOL / filesystemobject

Discussion in 'Software' started by paul1145, Dec 4, 2007.

  1. paul1145

    paul1145 Private E-2

    Hi, obvious rookie here.

    This piece of html / vbscript works on the client side with the file I want to access sitting in a directory on my PC. I upload the code and the file to my AOL space, and I have no luck accessing the file. I've even saved (as I was directed by another 'guru' as .hta but can't seem to get the members.aol.com to recognize it.) All I wish to accomplish is to open a web page, display entries in a listbox from a file sitting on the AOL server. Sorry to introduce this stuff on my first visit to this site, but I'm as frustrated as I've been in a long time trying to get vbscript to work consistently. Thanks for your help.

    Paul....

    <html>
    <head>
    <title>My Page</title>
    </head>
    <SCRIPT Language="VBScript">
    option explicit
    dim strContents(700)
    dim jmax
    dim fpath
    Sub FillListbox
    dim i
    dim oOption
    dim objOption
    For i = 0 to jmax - 1
    set oOption = document.createElement("OPTION")
    AvailColl.Options.add oOption
    oOption.innerText = strContents(i)
    oOption.value = i
    Next
    document.getElementById("twobutton").disabled = true
    End Sub
    Sub FillList
    dim i
    dim sScriptPath
    dim objFSO
    dim objFile
    dim objReadFile
    ' the file name is is hobbywebinx.dat _
    ' located in "http://members.aol.com/pblair/"
    sScriptPath = location.pathname
    ' this produces "pblair/index.html"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.GetFile("what do I use here?")
    If objFile.Size > 0 Then
    msgbox "Got it"
    else
    msgbox "Didn't get it"
    exit sub
    end if
    if objFSO.FileExists("what do I use here?") then
    'msgbox " GOT IT !!!!"
    Set objFile = objFSO.GetFile("what do I use here?")
    i = 0
    If objFile.Size > 0 Then
    Set objReadFile = objFSO.OpenTextFile("what do I use here?", 1)
    jmax = objReadFile.Read(2)
    objReadFile.SkipLine
    Do Until objReadFile.AtEndOfStream
    strContents(i) = objReadFile.Read(62)
    objReadFile.SkipLine
    i = i + 1
    Loop
    objReadFile.Close
    End If
    else
    msgbox "DIDN'T GET IT !!!"
    end if
    ' this routine puts the entries just read into the listbox
    FillListbox
    Set objFSO = Nothing
    Set objFile = Nothing
    Set objReadFile = Nothing
    End Sub
    </SCRIPT>

    <body bgcolor="palegreen">
    <center><b>Welcome To<br><font face="arial" color="navy" size="+2">My Page</font><br></b>
    <font size="-1"></font>
    </center><hr><br><br>
    <center>
    <select size="8" name="AvailColl" style="width:450; font-family: Courier New; font-size: 12px">
    </select><br><br>
    <input id=twobutton class="button" type="button" value="Fill Listbox"
    name="two_button" onClick="FillList">
    </center>
    </body>
    </html>
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds