تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مشروع تحميل ملفات من الانترنت
#1
رأيت برنامج شبيه هنا ولكن الاختلاف لا يضر يفيد في الاطلاع




لمحة عن الكود

PHP كود :
Private WithEvents downloader As New FileDownloader 


PHP كود :
' A simple implementation of setting the directory path, 
adding files from a textbox and starting the download
Private Sub btnStart_Click(ByVal sender As System.Object_
    ByVal e 
As System.EventArgsHandles btnStart.Click
    Dim openFolderDialog 
As New FolderBrowserDialog
    With downloader
        If openFolderDialog
.ShowDialog() = Windows.Forms.DialogResult.OK Then
            
.Files.Clear()
 
           .LocalDirectory openFolderDialog.SelectedPath
            For Each path 
As String In txtFilesToDownload.Lines
           
' The FileInfo structure will parse your path, 
      ' 
and split it to the path itself and the file name
     
 ' which will both be available for you
                .Files.Add(New FileDownloader.FileInfo(path))
            Next
            .Start()
        End If
    End With
End Sub 


PHP كود :
Private Sub btnPauze_Click(ByVal sender As System.Object_
        ByVal e 
As System.EventArgsHandles btnPauze.Click
    
' Pause the downloader
    downloader.Pause()
End Sub 

PHP كود :
Private Sub btnResume_Click(ByVal sender As System.Object_
        ByVal e 
As System.EventArgsHandles btnResume.Click
    
' Resume the downloader
    downloader.Resume()
End Sub 

PHP كود :
Private Sub btnStop_Click(ByVal sender As System.Object_
        ByVal e 
As System.EventArgsHandles btnStop.Click
    
' Stop the downloader
    ' 
NoteThis will not be instantaneous the current requests need to 
    
' be closed down, and the downloaded files need to be deleted
    downloader.Stop()
End Sub 


PHP كود :
' This event is fired every time the paused or busy state is changed, 
and used here to set the controls of the interface
Private 
Sub downloader_StateChanged() _
    Handles downloader
.StateChanged 'This is equal to: Handles 
                       '
downloader.IsBusyChangeddownloader.IsPausedChanged
    
' Setting the buttons
    btnStart.Enabled = downloader.CanStart
    btnStop.Enabled = downloader.CanStop
    btnPauze.Enabled = downloader.CanPause
    btnResume.Enabled = downloader.CanResume

    ' 
Enabling or disabling the setting controls
    txtFilesToDownload
.ReadOnly downloader.IsBusy
    cbUseProgress
.Enabled Not downloader.IsBusy
End Sub 

PHP كود :
' Occurs every time a block of data has been downloaded, 
and can be used to display the progress with
' Note that you can also create a timer, and display the progress 
every certain interval
' Also note that the progress properties return a size in bytes, 
which is not really user friendly to display
' The FileDownloader class provides shared functions to format these 
byte amounts to a more readable formateither in binary or decimal notation
Private Sub downloader_ProgressChanged() Handles downloader.ProgressChanged
    pBarFileProgress
.Value CInt(downloader.CurrentFilePercentage)
 
   lblFileProgressDetails.Text String.Format("Downloaded {0} of {1} ({2}%)"_
        FileDownloader
.FormatSizeBinary(downloader.CurrentFileProgress), _
        FileDownloader
.FormatSizeBinary(downloader.CurrentFileSize), _
        downloader
.CurrentFilePercentage) & String.Format(" - {0}/s"_
        FileDownloader
.FormatSizeBinary(downloader.DownloadSpeed))
 
   If downloader.SupportsProgress Then
        pBarTotalProgress
.Value CInt(downloader.TotalPercentage)
 
       lblTotalProgressDetails.Text _
        String
.Format("Downloaded {0} of {1} ({2}%)"_
        FileDownloader
.FormatSizeBinary(downloader.TotalProgress), _
        FileDownloader
.FormatSizeBinary(downloader.TotalSize), _
        downloader
.TotalPercentage)
 
   End If
End Sub 


الملفات المرفقة
.zip   FileDownloaderSource.zip (الحجم : 30.21 ك ب / التحميلات : 246)
الرد }}}
تم الشكر بواسطة: sendbad100 , asemshahen5 , خلاف , خلاف
#2
جزاك الله خيرا وبارك فيك أخي الفاضل
لا إله إلا الله وحده لا شريك له له الملك وله الحمد وهو على كل شئ قدير
سبحان الله وبحمده سبحان الله العظيم
سبحان الله والحمد لله ولا إله إلا الله والله أكبر ولا حول ولا قوة إلا بالله العلى العظيم
رب أغفر لي 

الرد }}}
تم الشكر بواسطة: viv


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [مشروع] مشروع ادارة المراكز الطبية رضوان الجماعي 8 3,161 20-12-23, 06:30 AM
آخر رد: Taha Okla
Brick [VB.NET] مشروع بسيط يحتوي على مجموعة من الأمثلة المفيدة لتعليم البرمجة بلغة VB.NET musalem 1 906 17-08-23, 12:07 PM
آخر رد: تركي احمد
Brick [VB.NET] سورس كود LCD CLOCKZ هو مشروع لساعة ديجيتال بشكل مميز وجذاب musalem 0 532 04-07-23, 02:08 AM
آخر رد: musalem
  [مشروع] مشروع إدارة الأقساط قابل للتعديل musalem 5 871 17-06-23, 09:59 AM
آخر رد: atefkhalf2004
  مشروع تعدد لغات للبرنامج من قاعدة بيانات MsAccess asemshahen5 6 3,652 18-05-23, 03:39 AM
آخر رد: mohamed gida
Wink [مشروع] مشروع تصميم فورم بشكل جديد بالفيجوال ستوديو مع السورس كود ahmadpal 8 6,993 12-04-23, 11:41 PM
آخر رد: spiky
  مشروع لعرض المستندات وملفات الـ بي دي اف ومعظم أنواع الصور عبدالله الدوسري 4 38,620 02-04-23, 10:47 PM
آخر رد: naz123
  مشروع ارسال رسائل واتس اب تلقائيا هديه مني للمنتدي اليوم السابع 14 11,227 30-03-23, 08:47 PM
آخر رد: sanyor77
  [VB.NET] سورس كود برنامج تشغل القران الكريم عبر الانترنت [ تم تحديث الموضوع ] elgokr 11 8,378 27-03-23, 10:35 AM
آخر رد: Hend m
  [مثال] اظهارشريط تقدم اثناء نسخ او نقل ملفات asmarsou 0 588 20-12-22, 09:33 PM
آخر رد: asmarsou

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم