سلام .
من ازین کتابخونه همون زمانی که منتشر شد استفاده میکنم برای دانلود نسخه جدید برنامه ازداخل خود برنامه ...
الان که میخوام برنامه رو بروز کنم با این کتابخونه فایل رو دانلود نمیکنه . دکمه دانلود رو که میزنه میگه unsupported response code 301
خیلی گیر کردم لینک دانلودم هم درسته . لطفا راهنمایی کنید
کدهامم میزارم
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: false
#End Region
Sub Process_Globals
End Sub
Sub Globals
Dim downloader As AriaMultiThreadDownload 'ijad kardane downloader
Dim conf As AriaMultiThreadDownloadConfiguration 'ijad kardane tanzimate downloader
Private ProgressBar1 As ProgressBar
Private pnldownload As Panel
' Private Panel1 As Panel
Private Label1 As Label
Private EditText1 As EditText
Dim rp2 As RuntimePermissions
Dim stat As StatusBarCompat
Private pnlbala As Panel
Private Button1 As Button
Private Button2 As Button
Private Button7 As Button
Private Button10 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("dl")
rp2.CheckAndRequest("android.permission.WRITE_EXTERNAL_STORAGE")
downloader.Initialize(conf) ' downloader ro az tariqe tanzimati ke moshakhas shode initialize mikonim
EditText1.Text="https://biaupload.com/do.php?downf=org-29428beaa4fc1.apk"
End Sub
Sub Activity_Resume
End Sub
Sub Activity_PermissionResult (Permission As String, Result As Boolean)
If Permission = "android.permission.WRITE_EXTERNAL_STORAGE" Then
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub AriaMultiThreadDownload_OnFailed(error As String)
'az tariqe sender mitunin tag ro begirin va befahmin ke maqadiri ke behetun dade marbut be kodum downloade
'har tagi ke tuye methode download estefade konin inja behetun dade mishe
Dim tag As Int = Sender
Select tag
Case 1
Label1.Text = "دانلود با شکست مواجه شد ! ,خطا : " & error
End Select
End Sub
Sub AriaMultiThreadDownload_OnDownloadPaused
'az tariqe sender mitunin tag ro begirin va befahmin ke maqadiri ke behetun dade marbut be kodum downloade
'har tagi ke tuye methode download estefade konin inja behetun dade mishe
Dim tag As Int = Sender
Select tag
Case 1
Label1.Text = "دانلود در حال توقف موقت"
End Select
End Sub
Sub AriaMultiThreadDownload_OnCompleted
'az tariqe sender mitunin tag ro begirin va befahmin ke maqadiri ke behetun dade marbut be kodum downloade
'har tagi ke tuye methode download estefade konin inja behetun dade mishe
Dim tag As Int = Sender
Select tag
Case 1
ProgressBar1.Progress = 100
Dim name As String = downloader.Utils.GuessFileNameFromLink(EditText1.Text)
Label1.Text = "کامل شد - " & name & " - " & downloader.Utils.CalcSize_EN(File.Size(File.DirRootExternal,name))
Try
'
If File.Exists(File.DirRootExternal ,"shomaresh_makos.apk") Then
Dim pckg As PersianPackageManager
pckg.initialize("pckg")
pckg.installPackageFromFile(File.DirRootExternal&"/shomaresh_makos.apk")
End If
Catch
Msgbox("فایل برنامه دانلود شد و در فایل منیجر شما ذخیره شد جهت نصب به پوشه فایل ها مراجعه و برنامه را نصب کنید .","اتمام دانلود")
End Try
End Select
End Sub
Sub AriaMultiThreadDownload_OnProgress (finished As Long,total As Long,progress As Int,speed As Long)
Dim text As String = "در حال دانلود - " & downloader.Utils.CalcSize_EN(finished) &" / " & downloader.Utils.CalcSize_EN(total) & " - " & progress & " % - Speed : " & downloader.Utils.CalcSize_EN(speed)
'az tariqe sender mitunin tag ro begirin va befahmin ke maqadiri ke behetun dade marbut be kodum downloade
'har tagi ke tuye methode download estefade konin inja behetun dade mishe
Dim tag As Int = Sender
Select tag
Case 1
ProgressBar1.Progress = progress
Label1.Text = text
End Select
End Sub
Sub downloadBTN_Click
Try
ProgressDialogShow("در حال دریافت اطلاعات...")
downloader.GetUrlInfo(EditText1.Text)
Catch
Msgbox("صفحه را ببندید و دوباره باز کنید","پیام سیستم")
End Try
End Sub
Sub AriaMultiThreadDownload_GetInfo (info As UrlInfo) ' in sub bad az
ProgressDialogHide
If info.HasInfo Then 'agar link doros bude bashe va info dashte bashe in meqdar true hast dar qeyre in surat agar link kharab ya eshtebah bashe false
DateTime.DateFormat = "dd-MM-yyyy" ' baraye tabdil kardane tarikhi ke server mide be halati ke beshe uno khund
Dim t1 As String = "نام فایل : "&CRLF & info.Name &CRLF&CRLF
Dim t2 As String = "MimeType : "&CRLF & info.MimeType &CRLF&CRLF
' Dim t3 As String = "Size EN : "&CRLF & downloader.Utils.CalcSize_EN(info.Length) &CRLF&CRLF
Dim t4 As String = "حجم فایل : "&CRLF & downloader.Utils.CalcSize_FA(info.Length) &CRLF&CRLF
Dim t5 As String = "آخرین ویرایش : "&CRLF & DateTime.Date(info.LastModified) &CRLF&CRLF
Dim t6 As String = "تاریخ : "&CRLF & DateTime.Date(info.Date) &CRLF&CRLF
Msgbox(t1&t2&t4&t5&t6,"اطلاعات لینک دانلود")
End If
End Sub
Sub Button1_Click
'Start/Resume button (1)
' CreateRequestAndDownload(EditText1.Text,1)
CreateRequestAndDownload("http://safireshgh.net/images/taqvimsafireshgh.apk",1)
End Sub
Sub Button2_Click
'Pause button (1)
downloader.Pause(1)
End Sub
Sub Button7_Click
'Delete button (1)
Try
If downloader.IsRunning(1) Then 'agar download ba tag 1 dar hale ejra bud
ToastMessageShow("first pause the task",False)
Return
End If
downloader.Delete(1) ' hazf kardane download ba tag 1
Label1.Text = "حذف شد"
ProgressBar1.Progress = 0
Catch
Msgbox("صفحه را ببندید و دوباره باز کنید","پیام سیستم")
End Try
End Sub
Sub Button10_Click
'GetInfo button (1)
Try
ProgressDialogShow("در حال دریافت اطلاعات...")
downloader.GetUrlInfo(EditText1.Text) ' gereftane etelaate file az server ke javab tuye sub AriaMultiThreadDownload_GetInfo dade mishe
Catch
Msgbox("صفحه را ببندید و دوباره باز کنید","پیام سیستم")
End Try
End Sub
Sub CreateRequestAndDownload(url As String,tag As Int) 'subi ke url va tag ro migire va download ro ijad mikone (in sub marbut be ketabkhune nis va dasti ijad shode)
If downloader.Utils.IsValidUrl(url) Then ' check kardane sahih budane link
Dim request As AriaMultiThreadDownloadRequest ' sakhtane requeste jadid
Dim name As String = downloader.Utils.GuessFileNameFromLink(url) 'gereftane esme file az link (offline)
request.SetFolder(File.DirRootExternal).SetName(name).SetUrl(url).Build 'moshakhas kardane folder va esme zakhire file va url ya linke download va sakhtane request
downloader.Download(request,tag) ' download kardane request va moshakhas kardane ye tag baraye ravande un download
Else
Msgbox("لینک دانلود صحیح نمی باشد !","خطا !") ' agar link eshtebah bashe error dade she
End If
End Sub