SefaKuru Posted April 1, 2015 Share Posted April 1, 2015 S.a arkadaşlar autoit' de yeniyim. Şimdi autoit ile giriş işlemlerini yaptırdım. Her şeyi hazır. Şimdi giriş işlemi başarılı olunca giriş kısmı kapanmıyor ve girişten sonra çalışacak olan açılıyor. yani giriş ve açılmasını istediğim pencereler duruyor. Giriş işlemi başarılı olunca kapanmasını ve sadece açılacak olan pencerenin kalmasını istiyorum. Açılacak olan pencerenin kodlarını nereye eklemem gerekiyor. Bir Türlü yapamadım. Birde ESC tuşuyla kapanmasını nasıl engelleyebilirim. Açılacak olan pencere kodlarını paylaşmadım. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("program", 432, 203, @DesktopWidth/2 - 432/2, @DesktopHeight/2 - 203/2) $Input1 = GUICtrlCreateInput("", 129, 56, 241, 21) $Label1 = GUICtrlCreateLabel(" Nick:", 48, 56, 82, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF) $Label2 = GUICtrlCreateLabel("Şifre:", 54, 88, 77, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF) $Input2 = GUICtrlCreateInput("", 129, 88, 241, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD)) $Label3 = GUICtrlCreateLabel("Giriş Yap", 126, 8, 178, 40) GUICtrlSetFont(-1, 20, 400, 0, "Bebas") GUICtrlSetColor(-1, 0x171717) $Button1 = GUICtrlCreateButton("Giriş Yap", 143, 128, 145, 33) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 validateAcc(GUICtrlRead($Input1) , GUICtrlRead($Input2)) if validateAcc(GUICtrlRead($Input1) , GUICtrlRead($Input2)) == "true" Then MsgBox(0, "Giriş", "Giriş Başarılı.") GUICtrlSetState($Input1, $GUI_HIDE) GUICtrlSetState($Input2, $GUI_HIDE) GUICtrlSetState($Label1, $GUI_HIDE) GUICtrlSetState($Label2, $GUI_HIDE) GUICtrlSetState($Button1, $GUI_HIDE) GUICtrlSetState($Label3, $GUI_HIDE) Else MsgBox(0, "Hata", "Giriş Bilgileriniz Yanlış veya Lisansınız Bitmiş.") EndIf EndSwitch WEnd ; <a href='http://www.autoitscript.com/forum/topic/69501-drivegetserial-report-different-hdd-serial-no/page__hl__drive++serial' class='bbc_url' title=''>http://www.autoitscript.com/forum/topic/69501-drivegetserial-report-different-hdd-serial-no/page__hl__drive++serial</a> ; <a href='http://www.codeproject.com/KB/cs/hard_disk_serialno.aspx' class='bbc_url' title='External link' rel='nofollow external'>http://www.codeproject.com/KB/cs/hard_disk_serialno.aspx</a> Func _Mac() ; Adapted function ; 06/09/2011 ; <a href='http://www.autoitscript.com/forum/topic/93183-wmi-ip-data/' class='bbc_url' title=''>http://www.autoitscript.com/forum/topic/93183-wmi-ip-data/</a> Local $objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2") Local $colAdapters = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True") If IsObj($colAdapters) then For $objAdapter In $colAdapters Return $objAdapter.MACAddress Next Else Return False Endif EndFunc Func validateAcc($username, $password) $http = ObjCreate("winhttp.winhttprequest.5.1") $http.Open("GET", "http://localhost/get.php?username=" & $username & "&password=" & $password & "&seri_nu=" & _Mac() & @LF, False) $http.Send() $received = $http.ResponseText return $received EndFunc Kodları düzenlerseniz çok teşekkür ederim Quote Link to comment Share on other sites More sharing options...
MostWanted Posted April 2, 2015 Share Posted April 2, 2015 (edited) http://www.tnctr.com/topic/178482-2-gui-ile-calythmak/ Konusunda nasıl 2 Gui ile çalışalacağını anlattım. Sen de ona benzer kodları; if validateAcc(GUICtrlRead($Input1) , GUICtrlRead($Input2)) == "true" Then MsgBox(0, "Giriş", "Giriş Başarılı.") kodlarından sonra yazarak kullanırsan istediğini elde edebilirsin. ESC ile çıkmayı engellemek için; Opt("GUICloseOnESC", 0); satırının kodunun başına koyarsan işini görecektir. Kolay gelsin. Edited April 2, 2015 by MostWanted Quote Link to comment Share on other sites More sharing options...
SefaKuru Posted April 2, 2015 Author Share Posted April 2, 2015 Teşekkür ederim ama orada 2 gui beraber çalışıyor. ilk açılan gui kapanmıyor Quote Link to comment Share on other sites More sharing options...
MostWanted Posted April 2, 2015 Share Posted April 2, 2015 GUIDelete ile ilk guiyi silersen, olur gibi duruyor. Quote Link to comment Share on other sites More sharing options...
SefaKuru Posted April 2, 2015 Author Share Posted April 2, 2015 Çok teşekkür ederim MsgBox(0, "Giriş", "Giriş Başarılı.") İfadesinden sonra GUIDelete(); fonksiyonunu kullandım ve tam istediğim gibi oldu. Eyvallah kolay gelsin herkese :) Quote Link to comment Share on other sites More sharing options...
SefaKuru Posted April 3, 2015 Author Share Posted April 3, 2015 Bir şey daha sormak istiyorum. Girişi php sayfasından 2 gün arasındaki süreyi hesaplattım. Programdan giriş yapıldığında gün sayısını gösteren değişkeni nasıl okutturabilirim ? Mesela bugun giriş yaptı 3 gün kaldı, sonraki gün giriş yaptı 2 gün kaldı şeklinde Quote Link to comment Share on other sites More sharing options...
MostWanted Posted April 3, 2015 Share Posted April 3, 2015 (edited) Kodunun başına, #include <Date.au3> eklersin. Sonra da $iDateCalc = _DateDiff('d', -senin tarihin-, _NowCalc()) yazarak gün farkını bulursun. Tarihi nasıl çekiyorsun bilemiyorum ama YYYY/MM/DD formatında yazman gerek. Edited April 3, 2015 by MostWanted Quote Link to comment Share on other sites More sharing options...
SefaKuru Posted April 3, 2015 Author Share Posted April 3, 2015 Hayır tam olarak istediğim o değil. Şimdi programdan giriş yapınca get.php den kontrol edip doğruysa programa giriş yapıyor ya. Atıyorum get.php de tarih ortalama değişkemiz $ortalama olsun bunu verita banından çekiyor ve sürekli değişiyor ben bunu programa nasıl aktarabilirim. Quote Link to comment Share on other sites More sharing options...
MostWanted Posted April 3, 2015 Share Posted April 3, 2015 ODBC gibi bir şey mi arıyorsun? Verini çektikten sonra $kalansure diye bi değişkene atarsın. Label'da gösterirsin. Quote Link to comment Share on other sites More sharing options...
SefaKuru Posted April 3, 2015 Author Share Posted April 3, 2015 Aslına bakarsanız ODBC nedir bilmiyorum kaynaklar var ama ingilizce olmadığından anlayamadım bir örnek verebilme şansınız var mıydı ? Quote Link to comment Share on other sites More sharing options...
SefaKuru Posted April 3, 2015 Author Share Posted April 3, 2015 Bunu da çözdüm hemen kodları vereyim belki birilerine lazım olur. Yaptığım tüm değişikleri kodların içine yazdım. Bu arada @MostWanted teşekkür ederim. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("program", 432, 203, @DesktopWidth/2 - 432/2, @DesktopHeight/2 - 203/2) $Input1 = GUICtrlCreateInput("", 129, 56, 241, 21) $Label1 = GUICtrlCreateLabel(" Nick:", 48, 56, 82, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF) $Label2 = GUICtrlCreateLabel("Şifre:", 54, 88, 77, 24) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF) $Input2 = GUICtrlCreateInput("", 129, 88, 241, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD)) $Label3 = GUICtrlCreateLabel("Giriş Yap", 126, 8, 178, 40) GUICtrlSetFont(-1, 20, 400, 0, "Bebas") GUICtrlSetColor(-1, 0x171717) $Button1 = GUICtrlCreateButton("Giriş Yap", 143, 128, 145, 33) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $WEBdata = validateAcc(GUICtrlRead($Input1) , GUICtrlRead($Input2)) ;burayı $WEBdata fonksiyonu natadım if $WEBdata = "false" Then ;Eğer php sayfasından giriş kontrolu yanlış ise hata verecek MsgBox(0, "Hata", "Giriş Bilgileriniz Yanlış veya Lisansınız Bitmiş.") Else MsgBox(0, "Kullanıcı Girişi", "Giriş Başarılı. Bizi tercih ettiğiniz için teşekkürler." & @lf & StringTrimRight($WEBdata,2)) ;php sayfasında kontrol ettirirken giriş doğru ise echo $string yazın ve öncesindende $string değişkenine istediğiniz değeri verin GUIDelete(); ;bir önceki gui yi sildik ;Buraya gözükmesini istediğiniz kodlar EndIf EndSwitch WEnd Func validateAcc($username, $password) $http = ObjCreate("winhttp.winhttprequest.5.1") $http.Open("GET", "http://localhost/get.php?username=" & $username & "&password=" & $password , False) $http.Send() $received = $http.ResponseText return $received EndFunc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.