رفتن به مطلب
  • 0

مشکل در تگ المنت


AHA_AMIRHOSEIN

سوال

سلام

من آموزش های تگ های المنت  رو

که در این پست

بود نگاه کردم و سورسشو نوشتم ولی نمیتونم سورس سایت رو بگیرم نمیدونم مشکلم چیه!!! اگه میشه کمکم کنین!!

 

 

دانلود سورس

#Region  Project Attributes 
	#ApplicationLabel: Blogfa
	#VersionCode: 1
	#VersionName: 
	'SupportedOrientations possible values: unspecified, landscape or portrait.
	#SupportedOrientations: unspecified
	#CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes 
	#FullScreen: False
	#IncludeTitle: True
#End Region

Sub Process_Globals
	'These global variables will be declared once when the application starts.
	'These variables can be accessed from all modules.
End Sub

Sub Globals
	'These global variables will be redeclared each time the activity is created.
	'These variables can only be accessed from this module.
    Public txtusername As EditText
	Private txtpassword As EditText
	Private txtcaptcha As EditText
	Private IMGcaptcha As ImageView
	Private date As Label
	''''''''''''''''''''''''
	Dim Httpjob1 As HttpJob
	Dim WebViewExtras1 As WebViewExtras
	Dim webview1 As WebView

	Private date As Label

	
	Private EditText1 As EditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
	'Do not forget to load the layout file created with the visual designer. For example:
	Activity.LoadLayout("ehem")
	Httpjob1.Initialize("myjob1",Me)
	webview1.Initialize("webview1")
	WebViewExtras1.addJavascriptInterface(webview1,"B4A")
	WebViewExtras1.addWebChromeClient(webview1,"")
	webview1.LoadUrl("217.219.20.41")
End Sub

Sub Activity_Resume

End Sub

    
Sub WebView1_PageFinished (Url As String)
    WebViewExtras1.executeJavascript(webview1,"B4A.callsub('Process_HTML'),true,document.documentelement.outerHTML)")
	WebViewExtras1.executeJavascript(webview1,"B4A.callsub('get_date',true,document.getelementbyid('lbldate').innertext)")

       End Sub 
Sub Process_HTML(Html As String)
    Html = Html.Replace("""","'")
	Dim captcha As String
	captcha = Html.SubString(Html.IndexOf("'captchaimage.axd?guid=")+1)
	captcha = "217.219.20.41"&captcha.SubString2(0,captcha.IndexOf("'")-0)
	Httpjob1.Download(captcha)
	ProgressDialogShow("در حال خواندن کد امنیتی")
'Msgbox(captcha,"link")
'EditText1.Text = Html

End Sub

Sub get_date (today As String)
	date.text = today
End Sub
Sub JOBdone (job As HttpJob)
	IMGcaptcha.Bitmap = job.GetBitmap
	IMGcaptcha.Gravity = Gravity.FILL
End Sub	
Sub tetusername_TextChanged (Old As String, New As String)
	WebViewExtras1.executeJavascript(webview1,"document.getelementsbyname('tetusername')[0].value = '"&New&"';"
End Sub
Sub txtPassword_TextChanged (Old As String, New As String)
	WebViewExtras1.executeJavascript(webview1,"document.getElementsByname('txtPassword')[0].value = '"&New&"';"
End Sub
Sub txyCaptcha_TextChanged (Old As String, New As String)
	WebViewExtras1.executeJavascript(webview1,"document.getelementsbyname('txyCaptcha')[0].value = '"&New&"';"
End Sub
Sub btnlogin_Click
	WebViewExtras1.executeJavascript(webview1,"document.getelementsbyid('loginbutton').click();"
End Sub
لینک ارسال
به اشتراک گذاری در سایت های دیگر

4 پاسخ به این سوال تاکنون داده شده است

ارسال‌های توصیه شده

این نمونه کد رو ببینید

 

این سالمه و کدهای سایت رو میگیره

#Region  Project Attributes 
	#ApplicationLabel: get
	#VersionCode: 1
	#VersionName: 
	#SupportedOrientations: portrait
	#CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes 
	#FullScreen: False
	#IncludeTitle: True
#End Region

Sub Process_Globals

End Sub

Sub Globals
	Dim king As StringUtils
	Dim t As AutoCompleteEditText
	Dim HttpJob1 As HttpJob
	Dim WebViewExtras1 As WebViewExtras
	Dim WebView1 As WebView
	Private ImageView1 As ImageView
	Private Date As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
	Activity.LoadLayout("get")
	HttpJob1.Initialize("Myjob1" , Me)
	WebView1.Initialize("WebView1")
	WebViewExtras1.addJavascriptInterface(WebView1 , "B4A")
	WebViewExtras1.addWebChromeClient(WebView1 , "")
	WebView1.LoadUrl("http://217.219.20.41/login.aspx")
End Sub

Sub WebView1_PageFinished(URL As String)
	WebViewExtras1.executeJavascript(WebView1,"B4A.CallSub('process_HTML',true,document.documentElement.outerHTML)")
	WebViewExtras1.executeJavascript(WebView1,"B4A.CallSub('Get_Date',true,document.getElementById('lblIP').innerText)")
End Sub

Sub process_HTML(HTML As String)
	HTML = HTML.Replace("""" , "'")
	t.Text = HTML
	Dim img As String
	img = HTML.SubString(HTML.IndexOf("'CaptchaImage.axd?guid=")+1)
	img = "http://217.219.20.41/"&img.SubString2(0,img.IndexOf("'")-0)
	HttpJob1.Download(img)
End Sub

Sub Get_Date(Today As String)
	Date.Text = Today
End Sub

Sub JobDone(job As HttpJob)
	ImageView1.Bitmap = job.GetBitmap
	ImageView1.Gravity = Gravity.FILL
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Button1_Click
	
End Sub
لینک ارسال
به اشتراک گذاری در سایت های دیگر

 

این نمونه کد رو ببینید

 

این سالمه و کدهای سایت رو میگیره

#Region  Project Attributes 
	#ApplicationLabel: get
	#VersionCode: 1
	#VersionName: 
	#SupportedOrientations: portrait
	#CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes 
	#FullScreen: False
	#IncludeTitle: True
#End Region

Sub Process_Globals

End Sub

Sub Globals
	Dim king As StringUtils
	Dim t As AutoCompleteEditText
	Dim HttpJob1 As HttpJob
	Dim WebViewExtras1 As WebViewExtras
	Dim WebView1 As WebView
	Private ImageView1 As ImageView
	Private Date As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
	Activity.LoadLayout("get")
	HttpJob1.Initialize("Myjob1" , Me)
	WebView1.Initialize("WebView1")
	WebViewExtras1.addJavascriptInterface(WebView1 , "B4A")
	WebViewExtras1.addWebChromeClient(WebView1 , "")
	WebView1.LoadUrl("http://217.219.20.41/login.aspx")
End Sub

Sub WebView1_PageFinished(URL As String)
	WebViewExtras1.executeJavascript(WebView1,"B4A.CallSub('process_HTML',true,document.documentElement.outerHTML)")
	WebViewExtras1.executeJavascript(WebView1,"B4A.CallSub('Get_Date',true,document.getElementById('lblIP').innerText)")
End Sub

Sub process_HTML(HTML As String)
	HTML = HTML.Replace("""" , "'")
	t.Text = HTML
	Dim img As String
	img = HTML.SubString(HTML.IndexOf("'CaptchaImage.axd?guid=")+1)
	img = "http://217.219.20.41/"&img.SubString2(0,img.IndexOf("'")-0)
	HttpJob1.Download(img)
End Sub

Sub Get_Date(Today As String)
	Date.Text = Today
End Sub

Sub JobDone(job As HttpJob)
	ImageView1.Bitmap = job.GetBitmap
	ImageView1.Gravity = Gravity.FILL
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Button1_Click
	
End Sub

سلام تا اینجاش درسته ولی وقتی میخوام مقدار رو عوض کنم خطا میده

Sub txtusername_TextChanged (Old As String, New As String)
	WebViewExtras1.executeJavascript(WebView1,"document.getElementsByName('txtusername')[0].value = '"&New&"';"
End Sub
Sub txtPassword_TextChanged (Old As String, New As String)
	WebViewExtras1.executeJavascript(WebView1,"document.getElementsByName('txtPassword')[0].value = '"&New&"';"
End Sub
Sub txy_Capt_TextChanged (Old As String, New As String)
	WebViewExtras1.executeJavascript(WebView1,"document.getElementsByName('TXT_CAPT')[0].value = '"&New&"';"
End Sub
Sub btnlogin_Click
	WebViewExtras1.executeJavascript(WebView1,"document.getelementsbyid('loginbutton').click();"
End Sub

 اینم از خطاش

B4A version 4.30
Parsing code.                           Error
Error parsing program.
Error description: Invalid number of parentheses.
Occurred on line: 74
WebViewExtras1.executeJavascript(WebView1,"document.getElementsByName('txtusername')[0].value = '"&New&"';"

 چیکار کنم ؟؟؟ :roomNemishe: :roomNemishe: :fekr:

لینک ارسال
به اشتراک گذاری در سایت های دیگر

بایگانی شده

این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.

  • کاربران آنلاین در این صفحه   0 کاربر

    • هیچ کاربر عضوی،در حال مشاهده این صفحه نیست.
×
×
  • اضافه کردن...