erezlevi Posted January 30, 2008 Share Posted January 30, 2008 Hi, how can I enlarge the buffer size here? in VB the .buffer = 2048 bytes. but in AutoIT it is only 378. ($s=$oIE.Buffer) Can anyone help here? autoit code: expandcollapse popup#include <Array.au3> #include <String.au3> Local $E[500] $oIE=ObjCreate ("socket.tcp") $oIE.DoTelnetEmulation = True $oIE.TelnetEmulation ="TTY" $oIE.Host = "9.148.218.20:23" $oIE.Open() $oIE.WaitFor("login:") $oIE.SendLine("ibm") $oIE.WaitFor("Password") $oIE.SendLine("ibm4isr") $oIE.WaitFor("System:") $oIE.SendLine("w2ktt") $oIE.WaitFor("Command:") $oIE.SendLine("list bcms skill 107") $oIE.WaitFor("BCMS") $s=$oIE.Buffer $oIE.SendLine(Chr(27) & "n") $oIE.Close() $oIE=0 $E[1]=$s $m=string($s) MsgBox (0,"string lenght:",StringLen ($m)) for $i=1 to StringLen ($s) $p1=StringInStr($m,Chr(27)) $p2=StringInStr($m,"H") $p3=($p2-$p1)+1 $p4=StringMid ($m,$p1,$p3) MsgBox (0,"$m before",$m) $m=StringReplace ($m,$p4," ") MsgBox (0,"$m after",$m) Next FileOpen ("c:\erez.txt",2) FileWrite ("c:\erez.txt",$m) VB code: expandcollapse popupOption Explicit Dim w3sock As Socket.TCP 'Dim scr As FileSystemObject Private Sub Command1_Click() Set w3sock = CreateObject("socket.tcp") 'Set fs = New FileSystemObject 'set f = With w3sock .DoTelnetEmulation = True .TelnetEmulation = "TTY" .Host = "9.148.218.20:23" .Open .WaitFor "login:" .SendLine "ibm" .SendLine "ibm4isr" .WaitFor "System:" .SendLine "w2ktt" .WaitFor "Command:" '.SendLine "~" 's = .GetText(2) 'MsgBox .Buffer '.WaitFor "Command:" 'MsgBox .Buffer .SendLine "list bcms skill 107" 'MsgBox .Buffer '.SendLine "{ESC}" & "x" .WaitFor "BCMS" 'MsgBox .Buffer Debug.Print Len(.Buffer) 'Debug.Print .Buffer Dim i As Long Dim s As String s = .Buffer Debug.Print Len(.Buffer) For i = 1 To 40 Debug.Print Mid(s, i, 1) & "=" & Asc(Mid(s, i, 1)) Next For i = 1 To Len(.Buffer) If InStr(InStr(1, s, Chr(27)), s, "H") = 0 Then Exit For s = Replace(s, Mid(s, InStr(1, s, Chr(27)), InStr(InStr(1, s, Chr(27)), s, "H") - InStr(1, s, Chr(27)) + 1), " ", 1) Next Debug.Print s .SendLine Chr(27) .SendLine "n" .WaitFor "BCMS" For i = 1 To Len(.Buffer) If InStr(InStr(1, s, Chr(27)), s, "H") = 0 Then Exit For s = Replace(s, Mid(s, InStr(1, s, Chr(27)), InStr(InStr(1, s, Chr(27)), s, "H") - InStr(1, s, Chr(27)) + 1), " ", 1) Next Debug.Print s .Close End With Set w3sock = Nothing End Sub Link to comment Share on other sites More sharing options...
erezlevi Posted January 31, 2008 Author Share Posted January 31, 2008 bump. Link to comment Share on other sites More sharing options...
BrettF Posted January 31, 2008 Share Posted January 31, 2008 Whats the "Socket.tcp" from? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
erezlevi Posted January 31, 2008 Author Share Posted January 31, 2008 Whats the "Socket.tcp" from?regsvr32 %WINDIR%\system32\Socket.dll Link to comment Share on other sites More sharing options...
BrettF Posted January 31, 2008 Share Posted January 31, 2008 regsvr32 %WINDIR%\system32\Socket.dllCrap. I don't have it. Well there goes that idea of seeing whats wrong. Maybe its time to wait for the COM god? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
erezlevi Posted January 31, 2008 Author Share Posted January 31, 2008 Crap. I don't have it. Well there goes that idea of seeing whats wrong. Maybe its time to wait for the COM god? here.don't forget to register it before using it. Link to comment Share on other sites More sharing options...
erezlevi Posted January 31, 2008 Author Share Posted January 31, 2008 Crap. I don't have it. Well there goes that idea of seeing whats wrong. Maybe its time to wait for the COM god? here.don't forget to register it before using it. Link to comment Share on other sites More sharing options...
erezlevi Posted January 31, 2008 Author Share Posted January 31, 2008 bump. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now