Jump to content

Recommended Posts

Posted

Hey!

Got a problem, it's hard to me, to explain what the problem is... here it comes:

I got this webpage.

"this" is the username, "is" is the password and "http://cool.com" is the homepage.

http://this:is@cool.com

I need a program, that reads the string, and takes the information apart and sets it up like this:

Username: This

Password: is

homepage: http://cool.com

Could this be possible?

sorry, for this bad explanation.

~WhOOt

Posted (edited)

Hey!

Got a problem, it's hard to me, to explain what the problem is... here it comes:

I got this webpage.

"this" is the username, "is" is the password and "http://cool.com" is the homepage.

http://this:is@cool.com

I need a program, that reads the string, and takes the information apart and sets it up like this:

Username: This

Password: is

homepage: http://cool.com

Could this be possible?

sorry, for this bad explanation.

~WhOOt

<{POST_SNAPBACK}>

It's not a bad explanation.

I see a program with a couple of Stringsplit functions, splitting it at the : and again at the @. You'd have to do a ControlGetText to get the address from the MSIE address bar....

Then read the different stringsplit arrays and have them spit out the information into a message box for debugging purposes.

Once you get that far, you've got it made.

Edit: Posted script

$msie = "Microsoft Internet Explorer"
AutoItSetOption("WinTitleMatchMode",2)
WinActivate($msie)
$addy = ControlGetText($msie,"","Edit1")
$addy = StringSplit($addy,":")
$temp = StringSplit($addy[3],"@")

;~ For $q = 1 to $addy[0]
;~ MsgBox(0,"debug",$addy[0] & " " & $addy[$q])
;~ Next

$user = StringTrimLeft($addy[2],2)
$pass = $temp[1]
$site = "http://" & $temp[2]

MsgBox(0,"Site","Site: " & $site & @LF & "Username: " & $user & @LF & "Password: " & $pass)
Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Posted

It's not a bad explanation.

I see a program with a couple of Stringsplit functions, splitting it at the : and again at the @.  You'd have to do a ControlGetText to get the address from the MSIE address bar....

Then read the different stringsplit arrays and have them spit out the information into a message box for debugging purposes. 

Once you get that far, you've got it made.

Edit:  Posted script

$msie = "Microsoft Internet Explorer"
AutoItSetOption("WinTitleMatchMode",2)
WinActivate($msie)
$addy = ControlGetText($msie,"","Edit1")
$addy = StringSplit($addy,":")
$temp = StringSplit($addy[3],"@")

;~ For $q = 1 to $addy[0]
;~ MsgBox(0,"debug",$addy[0] & " " & $addy[$q])
;~ Next

$user = StringTrimLeft($addy[2],2)
$pass = $temp[1]
$site = "http://" & $temp[2]

MsgBox(0,"Site","Site: " & $site & @LF & "Username: " & $user & @LF & "Password: " & $pass)

<{POST_SNAPBACK}>

i made a script myself, off what you just wrote :lmao:

Here it is:

$start = inputbox("", "insert homepage")
$string = $start
$first = stringreplace($string, "http://", "", 0, 0)
$second = stringsplit($first, ":" & "@")
$third = stringreplace($start, $second[1], "")
$fourth = stringreplace($third, $second[2], "")
$fifth = stringleft($fourth, 8)
$sixth = stringtrimleft($fourth, 9)

splashtexton("", "Username is: " & $second[1] & @lf & "Password is: " & $second[2] & @lf & "The Homepage is:   http://" & $sixth)
while 1
    wend
Posted

i made a script myself, off what you just wrote  :lmao:

Here it is:

$start = inputbox("", "insert homepage")
$string = $start
$first = stringreplace($string, "http://", "", 0, 0)
$second = stringsplit($first, ":" & "@")
$third = stringreplace($start, $second[1], "")
$fourth = stringreplace($third, $second[2], "")
$fifth = stringleft($fourth, 8)
$sixth = stringtrimleft($fourth, 9)

splashtexton("", "Username is: " & $second[1] & @lf & "Password is: " & $second[2] & @lf & "The Homepage is:   http://" & $sixth)
while 1
    wend

<{POST_SNAPBACK}>

Seems to me that your script would be limited by the length of the string? Or am I getting confused by the stringreplace? Have you tested it with different sizes of http://user:pass@host.com examples?

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Posted (edited)

This should work.

Edit:

- Improved. Now it also works with FTP addresses

$msie = "Microsoft Internet Explorer"
AutoItSetOption("WinTitleMatchMode",2)
If NOT WinExists($msie) Then
   EXIT
Else
   WinActivate($msie)
   $addy = ControlGetText($msie,"","Edit1")
EndIf
If StringInStr($addy, "//") AND StringInStr($addy, "@") Then
   $addy = StringSplit($addy,"@")
   $MatchPrefix = StringInStr($addy[1], "//") + 1
   $prefix = StringLeft($addy[1], $MatchPrefix)
   $site = $prefix & $addy[2]
   $User_Pass = StringTrimLeft($addy[1], StringLen($prefix))
   $User_Pass = StringSplit($User_Pass, ":")
   $user = $User_Pass[1]
   $pass = $User_Pass[2]
   MsgBox(0,"Site", "Username: " & $user & @LF & "Password: " & $pass & @LF & "homepage: " & $site)
EndIf
Edited by SlimShady
Posted

I don't use the SPy that much, but when I tried your code it didn't work.

I got Edit2 for the web address box when did the spy and when put that in the code it worked fine.

Can it be different for different computers? ?

This should work.

$msie = "Microsoft Internet Explorer"
AutoItSetOption("WinTitleMatchMode",2)
If NOT WinExists($msie) Then
   EXIT
Else
   WinActivate($msie)
   $addy = ControlGetText($msie,"","Edit1")
EndIf
If StringInStr($addy, ":", 0, 2) AND StringInStr($addy, "@") Then
   $addy = StringSplit($addy,"@")
   $site = $addy[2]
   $User_Pass = StringTrimLeft($addy[1], 7)
   $User_Pass = StringSplit($User_Pass, ":")
   $user = $User_Pass[1]
   $pass = $User_Pass[2]
   MsgBox(0,"Site","Site: " & $site & @LF & "Username: " & $user & @LF & "Password: " & $pass)
EndIf

<{POST_SNAPBACK}>

Posted

I don't use the SPy that much, but when I tried your code it didn't work.

I got Edit2 for the web address box when did the spy and when put that in the code it worked fine.

Can it be different for different computers? ?

<{POST_SNAPBACK}>

Forgive me if I sound n00bish, but ...

Do you have any extra search toolbars on?

What is giving you "Edit1" instead of your address bar?

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...