textbox question 
Author Message
 textbox question

Hello,
i have a few question according to textboxes.
1) when i create a textbox locally on my computer it works fine. But if i
start the script in a terminal server environment... no can do. i call the
text box with the following line:

<OBJECT ID=""bestanden"" WIDTH=300 HEIGHT=100
CLASSID=""CLSID:0713E8A2-850A-101B-AFC0-4210102A8DA7""><PARAM
NAME=""LineStyle"" VALUE=""1""><PARAM NAME=""Style"" VALUE=""7""><PARAM
NAME=""Appearance"" VALUE=""1""></OBJECT>"
can it be that the terminal server can't find the class-id in the register?
Maybe there is another way to get the same result. Can anyone point that out
to me??

2)  How do i get the values of a textbox? i put in values, but i want to
read out the selected value.

Thanks for your help anyone,

Rob Smienk

here's the entire script (if you might need it):
========================================================
<HTML>
<HEAD>
<TITLE>Rob's FTP App</TITLE>
<HTA:APPLICATION
   ID="oHTA"
      APPLICATIONNAME="FTP Application"
      BORDER="thin"
      BORDERSTYLE="raised"
      CAPTION="yes"
      ICON=""
      MAXIMIZEBUTTON="no"
      MINIMIZEBUTTON="no"
      SHOWINTASKBAR="no"
      SINGLEINSTANCE="yes"
      SYSMENU="no"
      VERSION="2.0"
      WINDOWSTATE="normal"
<Script Language = VBScript>

self.resizeto 700,400
set fso = createobject("scripting.filesystemobject")
set objshell = createobject("wscript.shell")

Const BIF_returnonlyfsdirs = &H0001
Const BIF_dontgobelowdomain = &H0002
Const BIF_statustext = &H0004
Const BIF_returnfsancestors = &H0008
Const BIF_editbox = &H0010
Const BIF_validate = &H0020
Const BIF_browseforcomputer = &H1000
Const BIF_browseforprinter = &H2000
Const BIF_browseincludefiles = &H4000
Const BSF_desktop = 0 'Desktop is the root directory. With
BIF_returnonlyfsdirs circumvents problem with OK-button
Const BSF_internetexplorer = 1 'Internet Explorer is the root
Const BSF_programs = 2 'Programs folder of the start menu is the root
Const BSF_controlpanel = 3 'Control Panel is the root. Needs
BIF_browseincludefiles
Const BSF_printers = 4 'Printers folder is the root. Needs
BIF_browseincludefiles
Const BSF_documents = 5 'Documentsfolder is the root
Const BSF_favorites = 6 'Favorites is the root
Const BSF_startup = 7 'Startup-folder of the startmenu is the root. Needs
BIF_browseincludefiles
Const BSF_recent = 8 'Recentfolder is the root. Needs BIF_browseincludefiles
Const BSF_sendto = 9 'Sendto-folder is the root. Needs
BIF_browseincludefiles
Const BSF_recyclebin = 10 'Recycle Bin is the root. Needs
BIF_browseincludefiles
Const BSF_startmenu = 11 'Start Menu is the root
Const BSF_desktopdirectory = 16 'The Desktopdirectory is the root directory
Const BSF_drives = 17 'The drives (My computer) folder is the root
Const BSF_network = 18 'The networkneighbourhood is the root
Const BSF_nethood = 19 'The nethoodfolder is the root
Const BSF_fonts = 20 'The fontsfolder is the root
Const BSF_templates = 21 'The templatesfolder is the root
Const cftp = "%comspec% /c c:\winnt\system32\ftp.exe"
const tokenfile = "tokenfile.rob"
Const bewaarpad = "pad.rob"
Const reloadfile = "reload.rob"
Const doelfile = "doel.rob"
Const tekstboxfile = "tekstbox.rob"
Const lsfile = "lsfile.rob"
Const ftplog = "ftplog.rob"
Const ftpres1 = "ftpfile.rob"
Const ftpdir = "directories.rob"
Const ftpbestand = "bestanden.rob"
Const sluitknop = "<br><br><BUTTON
onclick=""sluiten()"">Afsluiten</button>&nbsp&nbsp&nbsp<BUTTON
onclick=""DoReload()"">Begin Opnieuw</button>"
Const browseknop = "<BUTTON onclick=""selectdir()"">doel
directorie</button>"
Dim eentweetje

alingebruik ()

On Error Resume next
If fso.fileexists(bewaarpad) Then
 Set bewpad = fso.opentextfile (bewaarpad,2)
Else
 Set bewpad = fso.createtextfile (bewaarpad, true)
End If
Err.Clear

Function selectdir ()
 Dim strPath
 strPath = BrowseForFolder("kies een map", BIF_editbox + BIF_validate +
BIF_browseincludefiles, BSF_drives)
 If IsNull(strPath) Then
  If fso.fileexists(doelfile) Then fso.deletefile(doelfile)
  set doelbest = fso.createtextfile(doelfile, True)
  doelbest.writeline "Geen goede map geselecteerd"
 Else
  If fso.fileexists(doelfile) Then fso.deletefile(doelfile)
  set doelbest = fso.createtextfile(doelfile, True)
  doelbest.writeline strPath
 End If
 doelbest.close
 ftpen()
End Function

Function BrowseForFolder(strPrompt, BrowseInfo, root)
     On Error Resume Next
     Dim objShell, objFolder, intColonPos, objWshShell, returnerror
     Set objShell = CreateObject("Shell.Application")
     Set objWshShell = CreateObject("WScript.Shell")
     Set objFolder = objShell.BrowseForFolder(&H0, strPrompt, BrowseInfo,
root)
     BrowseForFolder =
objFolder.ParentFolder.ParseName(objFolder.Title).Path
     returnerror = err.number
     If returnerror <> 0 Then
          If returnerror = 424 then
               BrowseForFolder = Null
          else
               intColonPos = InStr(objFolder.Title, ":")
               If intColonPos > 0 Then
                    BrowseForFolder = Mid(objFolder.Title, intColonPos - 1,
2) & "\"
               End If
          End If
     End If
End Function

sub laatstedir()
If fso.fileexists(reloadfile) Then
 antwoord = MsgBox ("Wilt u nog een file ophalen uit dezelfde
directorie?",4)
 If antwoord = 6 Then
  If (fso.fileexists(tokenfile)) then fso.deletefile (tokenfile)
  downpad = padhalen (0)
   begin="&nbsp&nbsp&nbsp<select name=""tweede""
onchange=""ftpen()""><option selected>kies uit de lijst</option>"
  start="<br><br>Bestanden in bovenstaande directorie: <br><OBJECT
ID=""bestanden"" WIDTH=300 HEIGHT=100
CLASSID=""CLSID:0713E8A2-850A-101B-AFC0-4210102A8DA7""><PARAM
NAME=""LineStyle"" VALUE=""1""><PARAM NAME=""Style"" VALUE=""7""><PARAM
NAME=""Appearance"" VALUE=""1""></OBJECT>"
   best = ophalen ()
   eind="</select>"
  doeldirect = ophalendoel ()
  document.body.innerHTML="download pad is: " & downpad &
"<br>Doeldirectorie is: " & doeldirect & downpad & begin & best & eind &
start & sluitknop & browseknop
     Set tekstbox = fso.opentextfile(tekstboxfile)
    Do While Not tekstbox.atendofstream
        tekstlijn=tekstbox.readline
       execute tekstlijn
    Loop
'   downpad=padhalen(0)
'   doeldirect = ophalendoel ()
'   document.body.innerHTML="download pad is: " & downpad &
"<br>Doeldirectorie is: " & doeldirect & sluitknop & browseknop
 Else
  If (fso.fileexists(tokenfile)) then fso.deletefile(tokenfile)
  document.location.reload(true)
 End If
End if
End sub

sub alingebruik()
  Dim gebruiker, computer
  Set wshnetwork = CreateObject("wscript.network")
  gebruiker = wshnetwork.username
  computer = wshnetwork.computername
     If (fso.fileexists(tokenfile)) Then
      Set f = fso.opentextfile(tokenfile, 1, True, -1)
      usinguser = f.readline
      usingcomputer = f.readline
      usingdatetime = f.readline
      document.body.innerHTML="<H2>FTP APP is al in gebruik door " &
usinguser & Chr(10) & Chr(13) & "Computer naam: " & usingcomputer & Chr(10)
& Chr(13) & "sinds " & usingdatetime & "</H2>"
      f.close
      self.close
     Else
      Set f = fso.createtextfile(tokenfile, 2, True)
      f.writeline gebruiker
      f.writeline computer
      f.writeline Date & " " & Time
      f.close
     End If
End Sub

Function GetSelected(SelectName)
    Dim aantal
    Dim isgeselecteerd
    For aantal = 0 to SelectName.length
      If SelectName(aantal).Selected = True then
       isgeselecteerd = True
         Exit For
      End If
    Next
      If isgeselecteerd = True then
       GetSelected = SelectName(aantal).Text
    Else
       GetSelected = "Geen selectie gemaakt"
    End If
End Function

sub server
  start="<br><br>Bestanden in bovenstaande directorie: <br><OBJECT
ID=""bestanden"" WIDTH=300 HEIGHT=100
CLASSID=""CLSID:0713E8A2-850A-101B-AFC0-4210102A8DA7""><PARAM
NAME=""LineStyle"" VALUE=""1""><PARAM NAME=""Style"" VALUE=""7""><PARAM
NAME=""Appearance"" VALUE=""1""></OBJECT>"
        begin = "<select name= ""serverlist"" onchange= ""lijst()""><option
selected>kies uit de lijst</option>"
        eind = "</select>"
    servers =
"<option>informix</option><option>lifetime</option><option>DBserver</option>
<option>Lifetest</option>"
    downpad = padhalen(0)
    doeldirect = ophalendoel ()
     document.body.all ("serverlijst").innerHTML = "download pad is: " &
downpad & "<br>Doeldirectorie is: " & doeldirect & begin & servers & eind &
start & sluitknop & browseknop
end Sub

Sub lijst()
 servernaam=Getselected(serverlist)
 bewpad.writeline servernaam
 downpad = padhalen(0)
 start="<br><br>Bestanden in bovenstaande directorie: <br><OBJECT
ID=""bestanden"" WIDTH=300 HEIGHT=100
CLASSID=""CLSID:0713E8A2-850A-101B-AFC0-4210102A8DA7""><PARAM
NAME=""LineStyle"" VALUE=""1""><PARAM NAME=""Style"" VALUE=""7""><PARAM
NAME=""Appearance"" VALUE=""1""></OBJECT>"
 begin="&nbsp&nbsp&nbsp<select name=""opgehaald""
onchange=""ftpen()""><option selected>kies uit de lijst</option>"
 best = ophalen ()
 eind="</select>"
 doeldirect = ophalendoel ()
 document.body.innerHTML="download pad is: " & downpad & "<br>Doeldirectorie
is: " & doeldirect & downpad & begin & best & eind & start & sluitknop &
browseknop
    Set tekstbox = fso.opentextfile(tekstboxfile)
   Do While Not tekstbox.atendofstream
       tekstlijn=tekstbox.readline
      execute tekstlijn
   Loop
End Sub

Sub ftpen ()
 If eentweetje = 1 then
  selectie = GetSelected(tweede)
 Else
  selectie = GetSelected (opgehaald)
  eentweetje = 1
 End If
 MsgBox selectie
 If (selectie <> ("kies uit de lijst")) then bewpad.writeline selectie
 downpad = padhalen (0)
  begin="&nbsp&nbsp&nbsp<select name=""tweede"" onchange=""ftpen()""><option
selected>kies uit de lijst</option>"
 start="<br><br>Bestanden in bovenstaande directorie: <br><OBJECT
ID=""bestanden"" WIDTH=300 HEIGHT=100
CLASSID=""CLSID:0713E8A2-850A-101B-AFC0-4210102A8DA7""><PARAM
NAME=""LineStyle"" VALUE=""1""><PARAM NAME=""Style"" VALUE=""7""><PARAM
NAME=""Appearance"" VALUE=""1""></OBJECT>"
  best = ophalen ()
  eind="</select>"
 doeldirect = ophalendoel ()
 document.body.innerHTML="download pad is: " & downpad & "<br>Doeldirectorie
is: " & doeldirect & downpad & begin & best & eind & start & sluitknop &
browseknop
    Set tekstbox = fso.opentextfile(tekstboxfile)
   Do While Not tekstbox.atendofstream
       tekstlijn=tekstbox.readline
      execute tekstlijn
   Loop

End Sub

Sub ophalenftp (waarde)
 MsgBox "tja" & waarde
End sub

Function ophalen()
Dim cmdline
 Set lsbest = fso.createtextfile (lsfile, True)
 downdir = padhalen(2)
 servernm = padhalen(1)
 With lsbest
  .writeline "open " & servernm
  .writeline "[username]"
  .writeline "[password]"
  .writeline "cd /" & downdir
  .writeline "ls -aF"
  .writeline "bye"
 End With
 lsbest.close
 cmdline = cftp & " -s:" & Chr(34) & lsfile & Chr(34) & " > " & chr(34) &
ftplog & Chr(34)
 objshell.run cmdline, 0, True

 set best1 = fso.CreateTextFile(ftpres1, true)
 set backp = fso.opentextfile(ftplog)

 Set regEx = New RegExp   ' Create regular expression.
   regEx.Pattern = " "   ' Set pattern.
    regEx.IgnoreCase = True   ' Set case insensitivity.
    regEx.Global = True   ' Set global applicability.

    do while not backp.atendofstream
        lees = backp.readline
  if (instr(lees, "..")) then
   do while lees <> "226 Transfer complete."
    lees = backp.readline
    if lees = "226 Transfer complete." then
    else
     best1.writeline lees
    end if
   loop
  else
  end if
    loop
 best1.close

  set leesa = fso.Opentextfile(ftpres1, 1, True, 0)
 set leesc = fso.Opentextfile(ftpdir, 2, True, 0)
 set leesd = fso.Opentextfile(ftpbestand, 2, True, 0)

      do while not leesa.atendofstream
  lees=leesa.readline
  lengte = len(lees)
  karakter = mid(lees, lengte-1, 1)
  if karakter = "/" then
   leesc.writeline mid(lees, 1, lengte - 2)
  else
   leesd.writeline lees
  end if
 loop

  set leesb = fso.Opentextfile(ftpbestand, 1, True, 0)
  Set tekstbox = fso.createtextfile (tekstboxfile, True)

  do while not leesb.atendofstream
   teller=teller+1
   If teller < 10 Then
    teller = "00" & teller
   Elseif teller < 100 Then
    teller = "0" & teller
   End if
   lees = leesb.readline
   lengtestr = Len(lees)
   lees = Left(lees,(lengtestr-1))
  tekstbox.writeline "bestanden.Nodes.Add, , " & chr(34) & "A" & teller &
Chr(34) & ", " & chr(34) & lees & Chr(34)
  Loop

  set leesb = fso.Opentextfile(ftpdir, 1, True, 0)

  do while not leesb.atendofstream
   lees = leesb.readline
   ophalen=ophalen & "<option>" & lees & "</option>"
  loop
 backp.close
 leesa.close
 leesb.close
 leesc.close
 leesd.close
 tekstbox.close
 If fso.fileexists(lsfile) Then fso.deletefile(lsfile)
End function

function sluiten()
 If (fso.fileexists(tokenfile)) then fso.deletefile (tokenfile)
 If (fso.fileexists(reloadfile)) then fso.deletefile (reloadfile)
 If (fso.fileexists(ftplog)) Then fso.deletefile (ftplog)
 If (fso.fileexists(lsfile)) Then fso.deletefile (lsfile)
 If (fso.fileexists(doelfile)) Then fso.deletefile (doelfile)
 If (fso.fileexists(ftpres1)) Then fso.deletefile (ftpres1)
 If (fso.fileexists(tekstboxfile)) Then fso.deletefile (tekstboxfile)
 self.close
End Function

sub DoReload()
 fso.createtextfile (reloadfile)
 laatstedir()
end Sub

Function ophalendoel
 if fso.fileexists(doelfile) Then
  set doelbestand = fso.opentextfile (doelfile, 1)
 Else
  Set doelbestand = fso.createtextfile (doelfile, True)
  doelbestand.writeline "Geen goede map geselecteerd"
  doelbestand.close
  set doelbestand = fso.opentextfile (doelfile, 1)
 End If
 ophalendoel = doelbestand.readline & "<br>"
End function

function padhalen (plaats)
 Dim teller, teller2, padarray(), leesarr, doeldir
 teller = 0
 Set leespad = fso.opentextfile (bewaarpad, 1)
 Do While Not leespad.atendofstream
  leeslijn = leespad.readline
  teller = teller + 1
 Loop
 If teller <> 0 then
  leespad.close
  Set leespad = fso.opentextfile (bewaarpad, 1)
  teller2 = 1
  ReDim padarray(teller)
  Do While Not leespad.atendofstream
   leeslijn = leespad.readline
   padarray(teller2) = leeslijn
   teller2 = teller2 + 1
  Loop
  If plaats=1 Then
   padhalen = padarray(1)
   Exit function
  End if
  If plaats=2 Then
   If teller < 2 Then
    padhalen = "/"
    Exit function
   End If
   For i = 2 To teller
    padhalen = padhalen & padarray(i) & "/"
   Next
   Exit function
  Else
   padarray(1) = padarray(1) & ":"
   For i = 1 To teller
    padhalen = padhalen & padarray(i) & "/"
   Next
  End If
 Else
  padhalen = "Geen informatie aanwezig"
 End if
End function

</SCRIPT>
</HEAD>

<BODY bgcolor="#AAAAAA" onload="server">

<div id="serverlijst"></div><br>
</Body>
</HTML>
========================================================



Sat, 04 Dec 2004 16:31:18 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Pascal Programming

2. New Programmer needs help.

3. BP7 test8086 test8087 (MSDOS & DPMI) Delphi?

4. textbox question

5. Just Another Textbox Question

6. Textbox questions

7. TextBox question

8. vb.net textbox question

9. Textbox questions

10. textbox question

11. NewBee VB5 textbox question

12. tough textbox question

 

 
Powered by phpBB® Forum Software