بعد اینکه وقتی می خوام تمام کد ها رو بم با مسیج باکس نمایش بده نمیده
Sub WebView1_PageFinished (Url As String)
ProgressDialogHide
web.executeJavascript(WebView1,"learnnet.CallSub('process_HTML',true,document.documentElement.outerHTML)")
End Sub
Sub Process_HTML(HTML As String)
HTML = HTML.Replace("""","'")
Msgbox(HTML,"")
End Sub
چی کار کنم:
اینم کل کد ها
#Region Project Attributes
#ApplicationLabel: نجفی دو
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: false
#End Region
Sub Process_Globals
End Sub
Sub Globals
Private WebView1 As WebView
Private EditText1 As EditText
Private EditText3 As EditText
Private ImageView1 As ImageView
Private btnlogin As Label
Private btnrefresh As Button
Private EditText2 As EditText
Dim web As WebViewExtras
Dim pn As PNCaptchaPicker
Dim th As Thread
Dim my As MyWebViewClient
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layoutlogin")
web.AddJavascriptInterface(WebView1,"learnnet")
web.addWebChromeClient(WebView1,"")
pn.Initialize
pn.AddNewJavaScriptInterface(WebView1)
my.Initialize(WebView1,"WebView1")
WebView1.LoadUrl("http://najafi2school.ir/newpanels/")
ProgressDialogShow2("gf",False)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub WebView1_PageFinished (Url As String)
ProgressDialogHide
web.executeJavascript(WebView1,"learnnet.CallSub('process_HTML',true,document.documentElement.outerHTML)")
' web.executeJavascript(webview1,"learnnet.cullsub('get_username',true,documen.getElementByClassName('user-company-name').innertext)")
pn.Exequte(WebView1,"getcaptcha","document.getElementById('captcha_img')[0]")
End Sub
Sub Process_HTML(HTML As String)
HTML = HTML.Replace("""","'")
Msgbox(HTML,"")
End Sub
Sub getcaptcha(img As Object)
th.Initialise("")
th.RunOnGuiThread("setbitmap",Array As Object(img))
End Sub
Sub setbitmap(bitmap As Object)
ImageView1.Bitmap=bitmap ' کردن کپتچا روي ايميج ويو
End Sub
Sub btnmenu_Click
End Sub
Sub EditText1_TextChanged (Old As String, New As String)
'web.executeJavascript(WebView1,"document.getElementsByName('username')[0].value = '"&New&"';")
End Sub
Sub EditText2_TextChanged (Old As String, New As String)
'web.executeJavascript(WebView1,"document.getElementsByName('password')[0].value = '"&New&"';")
End Sub
Sub EditText3_TextChanged (Old As String, New As String)
' web.executeJavascript(WebView1,"document.getElementsByName('captcha')[0].value = '"&New&"';")
End Sub
Sub btnlogin_Click
web.executeJavascript(WebView1,"document.getElementsByName('username')[0].value = '"&EditText1.Text&"';")
web.executeJavascript(WebView1,"document.getElementsByName('password')[0].value = '"&EditText2.Text&"';")
web.executeJavascript(WebView1,"document.getElementsByName('captcha')[0].value = '"&EditText3.Text&"';")
web.executeJavascript(WebView1,"document.getElementsByClassName('btn btn-primary btn-block')[0].click()")
End Sub
سوال
mostafa.kasiri 115
سلام
چند تا مشگل دارم که جدیدا برام اینطوری شده و کد ها ی گت المنت کار نمیدن
مشکل یک اینکه من می خوام با تگ نیم کار کنم و با این کد
web.executeJavascript(WebView1,"document.getElementsByName('username')[0].value = '"&New&"';")
وقتی در ادیت تکست چیزی مینویسم وب ویو در داخل خودش فقط اون متن رو قرار میده و
برای رویداد کلیک هم از این استفاده کردم ولی بازم متن ادیت تکست ها رو دب وب ویو فقط قرار میده
web.executeJavascript(WebView1,"document.getElementsByClassName('btn btn-primary btn-block')[0].click()")
بعد اینکه وقتی می خوام تمام کد ها رو بم با مسیج باکس نمایش بده نمیده
Sub WebView1_PageFinished (Url As String) ProgressDialogHide web.executeJavascript(WebView1,"learnnet.CallSub('process_HTML',true,document.documentElement.outerHTML)") End Sub Sub Process_HTML(HTML As String) HTML = HTML.Replace("""","'") Msgbox(HTML,"") End Sub
چی کار کنم:
اینم کل کد ها
#Region Project Attributes #ApplicationLabel: نجفی دو #VersionCode: 1 #VersionName: 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: unspecified #CanInstallToExternalStorage: False #End Region #Region Activity Attributes #FullScreen: False #IncludeTitle: false #End Region Sub Process_Globals End Sub Sub Globals Private WebView1 As WebView Private EditText1 As EditText Private EditText3 As EditText Private ImageView1 As ImageView Private btnlogin As Label Private btnrefresh As Button Private EditText2 As EditText Dim web As WebViewExtras Dim pn As PNCaptchaPicker Dim th As Thread Dim my As MyWebViewClient End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("Layoutlogin") web.AddJavascriptInterface(WebView1,"learnnet") web.addWebChromeClient(WebView1,"") pn.Initialize pn.AddNewJavaScriptInterface(WebView1) my.Initialize(WebView1,"WebView1") WebView1.LoadUrl("http://najafi2school.ir/newpanels/") ProgressDialogShow2("gf",False) End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub WebView1_PageFinished (Url As String) ProgressDialogHide web.executeJavascript(WebView1,"learnnet.CallSub('process_HTML',true,document.documentElement.outerHTML)") ' web.executeJavascript(webview1,"learnnet.cullsub('get_username',true,documen.getElementByClassName('user-company-name').innertext)") pn.Exequte(WebView1,"getcaptcha","document.getElementById('captcha_img')[0]") End Sub Sub Process_HTML(HTML As String) HTML = HTML.Replace("""","'") Msgbox(HTML,"") End Sub Sub getcaptcha(img As Object) th.Initialise("") th.RunOnGuiThread("setbitmap",Array As Object(img)) End Sub Sub setbitmap(bitmap As Object) ImageView1.Bitmap=bitmap ' کردن کپتچا روي ايميج ويو End Sub Sub btnmenu_Click End Sub Sub EditText1_TextChanged (Old As String, New As String) 'web.executeJavascript(WebView1,"document.getElementsByName('username')[0].value = '"&New&"';") End Sub Sub EditText2_TextChanged (Old As String, New As String) 'web.executeJavascript(WebView1,"document.getElementsByName('password')[0].value = '"&New&"';") End Sub Sub EditText3_TextChanged (Old As String, New As String) ' web.executeJavascript(WebView1,"document.getElementsByName('captcha')[0].value = '"&New&"';") End Sub Sub btnlogin_Click web.executeJavascript(WebView1,"document.getElementsByName('username')[0].value = '"&EditText1.Text&"';") web.executeJavascript(WebView1,"document.getElementsByName('password')[0].value = '"&EditText2.Text&"';") web.executeJavascript(WebView1,"document.getElementsByName('captcha')[0].value = '"&EditText3.Text&"';") web.executeJavascript(WebView1,"document.getElementsByClassName('btn btn-primary btn-block')[0].click()") End Sub
لطفا کمک کنید .
لینک ارسال
به اشتراک گذاری در سایت های دیگر
11 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.