علت اینکه در برداشت اطلاعات بوسیله job.getstring خروجی یه سری کد پی اچ پی ظاهر می شود.
#Region Project Attributes
#ApplicationLabel: B4A Example
#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
' www.Basic4Android.org
Sub Process_Globals
End Sub
Sub Globals
Private txtName As EditText
Private txtFamily As EditText
''''''''''''
Dim HttpJob1 As HttpJob
Dim HttpJob2 As HttpJob
Private ListView1 As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
HttpJob1.Initialize("sabt",Me)
HttpJob2.Initialize("dl",Me)
End Sub
' www.Basic4Android.org
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
HttpJob1.PostString("http://sandogh.gigfa.com/insert.php","name=" & txtName.Text & "&size=" & txtFamily.Text)
ProgressDialogShow("در حال ثبت کردن")
End Sub
' www.Basic4Android.org
' www.Basic4Android.org
Sub Button2_Click
HttpJob2.Download("http://sandogh.gigfa.com/show.php")
ProgressDialogShow("در حال بارگذاری")
End Sub
Sub ListView1_ItemLongClick (Position As Int, Value As Object)
Dim jodasazi() As String = Regex.Split("-",Value)
HttpJob1.PostString("http://sandogh.gigfa.com/delete.php","id=" & jodasazi(0))
ToastMessageShow(Value & "حذف شد",False)
End Sub
' www.Basic4Android.org
Sub JobDone(Job As HttpJob)
If Job.Success = True Then
If Job.JobName = "sabt" Then
Log(Job.GetString)
ProgressDialogHide
Else If Job.JobName = "dl" Then
Dim a() As String
Log(Job.GetString)
a = Regex.Split("<br>",Job.GetString)
ListView1.Clear
ProgressDialogHide
For i=0 To 1
Dim id As String
Dim name As String
Dim size As String
Dim jodasazi() As String = Regex.Split("#",a(i))
'id = jodasazi(0)
name = jodasazi(0)
'size = jodasazi(1)
ListView1.AddTwoLines(id &"-" & name,size)
Next
End If
End If
End Sub
سوال
HOSSEINI 10
سلام
علت اینکه در برداشت اطلاعات بوسیله job.getstring خروجی یه سری کد پی اچ پی ظاهر می شود.
#Region Project Attributes #ApplicationLabel: B4A Example #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 ' www.Basic4Android.org Sub Process_Globals End Sub Sub Globals Private txtName As EditText Private txtFamily As EditText '''''''''''' Dim HttpJob1 As HttpJob Dim HttpJob2 As HttpJob Private ListView1 As ListView End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("Main") HttpJob1.Initialize("sabt",Me) HttpJob2.Initialize("dl",Me) End Sub ' www.Basic4Android.org Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub Button1_Click HttpJob1.PostString("http://sandogh.gigfa.com/insert.php","name=" & txtName.Text & "&size=" & txtFamily.Text) ProgressDialogShow("در حال ثبت کردن") End Sub ' www.Basic4Android.org ' www.Basic4Android.org Sub Button2_Click HttpJob2.Download("http://sandogh.gigfa.com/show.php") ProgressDialogShow("در حال بارگذاری") End Sub Sub ListView1_ItemLongClick (Position As Int, Value As Object) Dim jodasazi() As String = Regex.Split("-",Value) HttpJob1.PostString("http://sandogh.gigfa.com/delete.php","id=" & jodasazi(0)) ToastMessageShow(Value & "حذف شد",False) End Sub ' www.Basic4Android.org Sub JobDone(Job As HttpJob) If Job.Success = True Then If Job.JobName = "sabt" Then Log(Job.GetString) ProgressDialogHide Else If Job.JobName = "dl" Then Dim a() As String Log(Job.GetString) a = Regex.Split("<br>",Job.GetString) ListView1.Clear ProgressDialogHide For i=0 To 1 Dim id As String Dim name As String Dim size As String Dim jodasazi() As String = Regex.Split("#",a(i)) 'id = jodasazi(0) name = jodasazi(0) 'size = jodasazi(1) ListView1.AddTwoLines(id &"-" & name,size) Next End If End If End Subلینک ارسال
به اشتراک گذاری در سایت های دیگر
8 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.