Frage von OrVCkugKFgHwgMc, 37

AutoIT GUI Input sending via Email?

Hi there,

i have problems sending an email because i only get the lengths of the inputs i enter.

This is for a cheap license system.

$Username = GUICtrlCreateInput("Username", 24, 64, 337, 54, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$WS_BORDER))
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")
$Password = GUICtrlCreateInput("Password", 27, 160, 337, 54, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_PASSWORD,$WS_BORDER))
GUICtrlSetFont(-1, 30, 400, 0, "MS Sans Serif")

These are the inputs i want to send via Email ^

$Body = "Username:Password | " & $Username & ":" & $Password

This is the email body ^

when i type

Username: Bread

Password: Fish

The email looks like this:

Username:Password | 5:4

So only the lengths of the strings are send .

Please tell me where the problem is.

Thank You

Antwort
von Suboptimierer, 19

Du musst die Werte der Eingabefelder mit GUICtrlRead abrufen. Folgender Code funktioniert bei mir:

Dim $Username
Dim $Password
Dim $Body
Dim $btn
Dim $smsg

#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>

GUICreate("Login", 200, 100) ;, @DesktopWidth / 2, @DesktopHeight / 2, -1, 0x00000018)
$Username = GUICtrlCreateInput("Username", 5, 5, 150, 19) ; , BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$WS_BORDER))
$Password = GUICtrlCreateInput("Password", 5, 25, 150, 19) ; , BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_PASSWORD,$WS_BORDER))
$btn = GUICtrlCreateButton("Ok", 5, 45, 60, 19) 

GUISetState()
$msg = 0
While $msg <> $GUI_EVENT_CLOSE
  $msg = GUIGetMsg()
  Select
    Case $msg = $btn
      ExitLoop
  EndSelect
WEnd

$Body = "Username:Password | " & GUICtrlRead ($Username) & ":" & GUICtrlRead($Password)
MsgBox(0, "Login", $Body)
Antwort
von OrVCkugKFgHwgMc, 12

This is the correct way :D Thank You

$Body = "Username:Password | " & GUICtrlRead($Username) & ":" & GUICtrlRead($Password)



Keine passende Antwort gefunden?

Fragen Sie die Community

Weitere Fragen mit Antworten