PDA

View Full Version : سوال: سوال در مورد نرم افزار دانلود منيجر



sajjad_tanha20
سه شنبه 06 فروردین 1392, 08:22 صبح
با سلام
دوستان من يه نرم افزار دانلود منيجر درست كردم كه همه چيزشم خوب كار ميكنه فقط ميخواستم وقتي رو لينك دانلودي مثلا تو فايرفاكس كليك ميكنم اين لينك به برنامه من اضافه بشه و شروع به دانلود كنه
دوستان لطفا راهنمايي كنين كه من چطور ميتونم اين قابليتم به برنامم اضافه كنم
مرسي

sajjad_tanha20
سه شنبه 06 فروردین 1392, 08:23 صبح
دوستان به یه مشکل جدید برخوردم
اونم اینکه نمیتونم از هاست هایی که یوزر و پسورد دارن دانلود کنم
چطور میشه از این هاست ها دانلود کرد
راستی من دانلود منیجرمو با class نوشتم نه webclint و اینا

با این class :

Option Strict On : Option Explicit On

Imports System.ComponentModel
Imports System.IO
Imports System.Net

Namespace Bn.Classes

#Region "Public Class FileDownloader"
''' <summary>Class for downloading files in the background that supports info about their progress, the total progress, cancellation, pausing, and resuming. The downloads will run on a separate thread so you don't have to worry about multihreading yourself. </summary>
''' <remarks>Class FileDownloader v1.0.3, by De Dauw Jeroen - May 2009</remarks>
Public Class FileDownloader
Inherits System.Object
Implements IDisposable

#Region "Nested types"

#Region "Public Structure FileInfo"
''' <summary>Simple structure for managing file info</summary>
Public Structure FileInfo
''' <summary>The complete path of the file (directory + filename)</summary>
Public Path As String
''' <summary>The name of the file</summary>
Public Name As String

''' <summary>Create a new instance of FileInfo</summary>
''' <param name="path">The complete path of the file (directory + filename)</param>
Public Sub New(ByVal path As String)
Me.Path = path
Dim txt As New RichTextBox
txt.Text = path
Me.Name = txt.Text.Split("/"c)(txt.Text.Split("/"c).Length - 1)
End Sub
End Structure
#End Region

#Region "Private Enum [Event]"
''' <summary>Holder for events that are triggered in the background worker but need to be fired in the main thread</summary>
Private Enum [Event]
CalculationFileSizesStarted

FileSizesCalculationComplete
DeletingFilesAfterCancel

FileDownloadAttempting
FileDownloadStarted
FileDownloadStopped
FileDownloadSucceeded

ProgressChanged
End Enum
#End Region

#Region "Private Enum InvokeType"
''' <summary>Holder for the action that needs to be invoked</summary>
Private Enum InvokeType
EventRaiser
FileDownloadFailedRaiser
CalculatingFileNrRaiser
End Enum
#End Region

#End Region

#Region "Events"
''' <summary>Occurs when the file downloading has started</summary>
Public Event Started As EventHandler
''' <summary>Occurs when the file downloading has been paused</summary>
Public Event Paused As EventHandler
''' <summary>Occurs when the file downloading has been resumed</summary>
Public Event Resumed As EventHandler
''' <summary>Occurs when the user has requested to cancel the downloads</summary>
Public Event CancelRequested As EventHandler
''' <summary>Occurs when the user has requested to cancel the downloads and the cleanup of the downloaded files has started</summary>
Public Event DeletingFilesAfterCancel As EventHandler
''' <summary>Occurs when the file downloading has been canceled by the user</summary>
Public Event Canceled As EventHandler
''' <summary>Occurs when the file downloading has been completed (without canceling it)</summary>
Public Event Completed As EventHandler
''' <summary>Occurs when the file downloading has been stopped by either cancellation or completion</summary>
Public Event Stopped As EventHandler

''' <summary>Occurs when the busy state of the FileDownloader has changed</summary>
Public Event IsBusyChanged As EventHandler
''' <summary>Occurs when the pause state of the FileDownloader has changed</summary>
Public Event IsPausedChanged As EventHandler
''' <summary>Occurs when the either the busy or pause state of the FileDownloader have changed</summary>
Public Event StateChanged As EventHandler

''' <summary>Occurs when the calculation of the file sizes has started</summary>
Public Event CalculationFileSizesStarted As EventHandler
''' <summary>Occurs when the calculation of the file sizes has started</summary>
Public Event CalculatingFileSize As FileSizeCalculationEventHandler
''' <summary>Occurs when the calculation of the file sizes has been completed</summary>
Public Event FileSizesCalculationComplete As EventHandler

''' <summary>Occurs when the FileDownloader attempts to get a web response to download the file</summary>
Public Event FileDownloadAttempting As EventHandler
''' <summary>Occurs when a file download has started</summary>
Public Event FileDownloadStarted As EventHandler
''' <summary>Occurs when a file download has stopped</summary>
Public Event FileDownloadStopped As EventHandler
''' <summary>Occurs when a file download has been completed successfully</summary>
Public Event FileDownloadSucceeded As EventHandler
''' <summary>Occurs when a file download has been completed unsuccessfully</summary>
Public Event FileDownloadFailed(ByVal sender As Object, ByVal e As Exception)

''' <summary>Occurs every time a block of data has been downloaded</summary>
Public Event ProgressChanged As EventHandler
#End Region

#Region "Fields"
Public Delegate Sub FileSizeCalculationEventHandler(ByVal sender As Object, ByVal fileNumber As Int32)

Private WithEvents bgwDownloader As New BackgroundWorker
Private trigger As New Threading.ManualResetEvent(True)

' Preferences
Private m_supportsProgress, m_deleteCompletedFiles As Boolean
Private m_packageSize, m_stopWatchCycles As Int32

' State
Private m_disposed As Boolean = False
Private m_busy, m_paused, m_canceled As Boolean
Private m_currentFileProgress, m_totalProgress, m_currentFileSize As Int64
Private m_currentSpeed, m_fileNr As Int32

' Data
Private m_localDirectory As String
Private m_files As New List(Of FileInfo)
Private m_totalSize As Int64
#End Region

#Region "Constructors"
''' <summary>Create a new instance of a FileDownloader</summary>
''' <param name="supportsProgress">Optional. Boolean. Should the FileDownloader support total progress statistics?</param>
Public Sub New(Optional ByVal supportsProgress As Boolean = False)
' Set the bgw properties
bgwDownloader.WorkerReportsProgress = True
bgwDownloader.WorkerSupportsCancellation = True

' Set the default class preferences
Me.SupportsProgress = supportsProgress
Me.PackageSize = 4096
Me.StopWatchCyclesAmount = 5
Me.DeleteCompletedFilesAfterCancel = False
End Sub
#End Region

#Region "Public methods"
''' <summary>Start the downloads</summary>
Public Sub Start()
Me.IsBusy = True
End Sub

''' <summary>pause the downloads</summary>
Public Sub Pause()
Me.IsPaused = True
End Sub

''' <summary>Resume the downloads</summary>
Public Sub [Resume]()
Me.IsPaused = False
End Sub

''' <summary>Stop the downloads</summary>
Public Overloads Sub [Stop]()
Me.IsBusy = False
End Sub

''' <summary>Stop the downloads</summary>
''' <param name="deleteCompletedFiles">Required. Boolean. Indicates wether the complete downloads should be deleted</param>
Public Overloads Sub [Stop](ByVal deleteCompletedFiles As Boolean)
Me.DeleteCompletedFilesAfterCancel = deleteCompletedFiles
Me.Stop()
End Sub

''' <summary>Release the recources held by the FileDownloader</summary>
Public Sub Dispose() Implements IDisposable.Dispose
Dispose(True)
GC.SuppressFinalize(Me)
End Sub

''' <summary>Format an amount of bytes to a more readible notation with binary notation symbols</summary>
''' <param name="size">Required. Int64. The raw amount of bytes</param>
''' <param name="decimals">Optional. Int32. The amount of decimals you want to have displayed in the notation</param>
Public Shared Function FormatSizeBinary(ByVal size As Int64, Optional ByVal decimals As Int32 = 2) As String
' By De Dauw Jeroen - April 2009 - jeroen_dedauw@yahoo.com
Dim sizes() As String = {" B", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"}
Dim formattedSize As Double = size
Dim sizeIndex As Int32 = 0
While formattedSize >= 1024 And sizeIndex < sizes.Length
formattedSize /= 1024
sizeIndex += 1
End While
Return Math.Round(formattedSize, decimals).ToString & sizes(sizeIndex)
End Function

''' <summary>Format an amount of bytes to a more readible notation with decimal notation symbols</summary>
''' <param name="size">Required. Int64. The raw amount of bytes</param>
''' <param name="decimals">Optional. Int32. The amount of decimals you want to have displayed in the notation</param>
Public Shared Function FormatSizeDecimal(ByVal size As Int64, Optional ByVal decimals As Int32 = 2) As String
' By De Dauw Jeroen - April 2009 - jeroen_dedauw@yahoo.com
Dim sizes() As String = {" B", " kB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"}
Dim formattedSize As Double = size
Dim sizeIndex As Int32 = 0
While formattedSize >= 1000 And sizeIndex < sizes.Length
formattedSize /= 1000
sizeIndex += 1
End While
Return Math.Round(formattedSize, decimals).ToString & sizes(sizeIndex)
End Function
#End Region

#Region "Private/protected methods"
Private Sub bgwDownloader_DoWork() Handles bgwDownloader.DoWork
Dim fileNr As Int32 = 0

If Me.SupportsProgress Then calculateFilesSize()

If Not Directory.Exists(Me.LocalDirectory) Then Directory.CreateDirectory(Me.LocalDirectory)

While fileNr < Me.Files.Count And Not bgwDownloader.CancellationPending
m_fileNr = fileNr
downloadFile(fileNr)

If bgwDownloader.CancellationPending Then
fireEventFromBgw([Event].DeletingFilesAfterCancel)
cleanUpFiles(If(Me.DeleteCompletedFilesAfterCancel , 0, m_fileNr), If(Me.DeleteCompletedFilesAfterCancel, m_fileNr + 1, 1))
Else
fileNr += 1
End If
End While
End Sub

Private Sub fireEventFromBgw(ByVal eventName As [Event])
bgwDownloader.ReportProgress(InvokeType.EventRaise r, eventName)
End Sub

Private Sub bwgDownloader_ProgressChanged(ByVal sender As Object, ByVal e As ProgressChangedEventArgs) Handles bgwDownloader.ProgressChanged
Select Case CType(e.ProgressPercentage, InvokeType)
Case InvokeType.EventRaiser
Select Case CType(e.UserState, [Event])
Case [Event].CalculationFileSizesStarted
RaiseEvent CalculationFileSizesStarted(Me, New EventArgs)
Case [Event].FileSizesCalculationComplete
RaiseEvent FileSizesCalculationComplete(Me, New EventArgs)
Case [Event].DeletingFilesAfterCancel
RaiseEvent DeletingFilesAfterCancel(Me, New EventArgs)

Case [Event].FileDownloadAttempting
RaiseEvent FileDownloadAttempting(Me, New EventArgs)
Case [Event].FileDownloadStarted
RaiseEvent FileDownloadStarted(Me, New EventArgs)
Case [Event].FileDownloadStopped
RaiseEvent FileDownloadStopped(Me, New EventArgs)
Case [Event].FileDownloadSucceeded
RaiseEvent FileDownloadSucceeded(Me, New EventArgs)
Case [Event].ProgressChanged
RaiseEvent ProgressChanged(Me, New EventArgs)
End Select
Case InvokeType.FileDownloadFailedRaiser
RaiseEvent FileDownloadFailed(Me, CType(e.UserState, Exception))
Case InvokeType.CalculatingFileNrRaiser
RaiseEvent CalculatingFileSize(Me, CInt(e.UserState))
End Select
End Sub

Private Sub cleanUpFiles(Optional ByVal start As Int32 = 0, Optional ByVal length As Int32 = -1)
Dim last As Int32 = If(length < 0, Me.Files.Count - 1, start + length - 1)
For fileNr As Int32 = start To last
Dim fullPath As String = Me.LocalDirectory & "\" & Me.Files(fileNr).Name
If IO.File.Exists(fullPath) Then IO.File.Delete(fullPath)
Next
End Sub

Private Sub calculateFilesSize()
fireEventFromBgw([Event].CalculationFileSizesStarted)
m_totalSize = 0

For fileNr As Int32 = 0 To Me.Files.Count - 1
bgwDownloader.ReportProgress(InvokeType.Calculatin gFileNrRaiser, fileNr + 1)
Try
Dim webReq As HttpWebRequest = CType(Net.WebRequest.Create(Me.Files(fileNr).Path) , HttpWebRequest)
Dim webResp As HttpWebResponse = CType(webReq.GetResponse, HttpWebResponse)
m_totalSize += webResp.ContentLength
webResp.Close()
Catch ex As Exception
End Try
Next
fireEventFromBgw([Event].FileSizesCalculationComplete)
End Sub

Private Sub downloadFile(ByVal fileNr As Int32)
m_currentFileSize = 0
fireEventFromBgw([Event].FileDownloadAttempting)

Dim file As FileInfo = Me.Files(fileNr)
Dim size As Int64 = 0

Dim readBytes(Me.PackageSize - 1) As Byte
Dim currentPackageSize As Int32
Dim writer As New FileStream(Me.LocalDirectory & "\" & file.Name, IO.FileMode.Create)
Dim speedTimer As New Stopwatch
Dim readings As Int32 = 0
Dim exc As Exception

Dim webReq As HttpWebRequest
Dim webResp As HttpWebResponse

Try
webReq = CType(Net.WebRequest.Create(Me.Files(fileNr).Path) , HttpWebRequest)
webResp = CType(webReq.GetResponse, HttpWebResponse)

size = webResp.ContentLength
Catch ex As Exception
exc = ex
End Try

m_currentFileSize = size
fireEventFromBgw([Event].FileDownloadStarted)

If exc IsNot Nothing Then
bgwDownloader.ReportProgress(InvokeType.FileDownlo adFailedRaiser, exc)
Else
m_currentFileProgress = 0
While m_currentFileProgress < size
If bgwDownloader.CancellationPending Then
speedTimer.Stop()
writer.Close()
webResp.Close()
Exit Sub
End If
trigger.WaitOne()

speedTimer.Start()

currentPackageSize = webResp.GetResponseStream().Read(readBytes, 0, Me.PackageSize)
m_currentFileProgress += currentPackageSize
m_totalProgress += currentPackageSize
fireEventFromBgw([Event].ProgressChanged)

writer.Write(readBytes, 0, currentPackageSize)
readings += 1

If readings >= Me.StopWatchCyclesAmount Then
m_currentSpeed = CInt(Me.PackageSize * StopWatchCyclesAmount * 1000 / (speedTimer.ElapsedMilliseconds + 1))
speedTimer.Reset()
readings = 0
End If
End While

speedTimer.Stop()
writer.Close()
webResp.Close()
fireEventFromBgw([Event].FileDownloadSucceeded)
End If
fireEventFromBgw([Event].FileDownloadStopped)
End Sub

Private Sub bgwDownloader_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles bgwDownloader.RunWorkerCompleted
Me.IsPaused = False
m_busy = False

If Me.HasBeenCanceled Then
RaiseEvent Canceled(Me, New EventArgs)
Else
RaiseEvent Completed(Me, New EventArgs)
End If

RaiseEvent Stopped(Me, New EventArgs)
RaiseEvent IsBusyChanged(Me, New EventArgs)
RaiseEvent StateChanged(Me, New EventArgs)
End Sub

Protected Overridable Sub Dispose(ByVal disposing As Boolean)
If Not m_disposed Then
If disposing Then
' Free other state (managed objects)
bgwDownloader.Dispose()
End If
' Free your own state (unmanaged objects)
' Set large fields to null
Me.Files = Nothing
End If
m_disposed = True
End Sub
#End Region

#Region "Properties"
''' <summary>Gets or sets the list of files to download</summary>
Public Property Files() As List(Of FileInfo)
Get
Return m_files
End Get
Set(ByVal value As List(Of FileInfo))
If Me.IsBusy Then
Throw New InvalidOperationException("You can not change the file list during the download")
Else
If Me.Files IsNot value Then m_files = value
End If
End Set
End Property

''' <summary>Gets or sets the local directory in which files will be stored</summary>
Public Property LocalDirectory() As String
Get
Return m_localDirectory
End Get
Set(ByVal value As String)
If value <> Me.LocalDirectory Then
m_localDirectory = value
End If
End Set
End Property

''' <summary>Gets or sets if the FileDownloader should support total progress statistics. Note that when enabled, the FileDownloader will have to get the size of each file before starting to download them, which can delay the operation.</summary>
Public Property SupportsProgress() As Boolean
Get
Return m_supportsProgress
End Get
Set(ByVal value As Boolean)
If Me.IsBusy Then
Throw New InvalidOperationException("You can not change the SupportsProgress property during the download")
Else
m_supportsProgress = value
End If
End Set
End Property

''' <summary>Gets or sets if when the download process is cancelled the complete downloads should be deleted</summary>
Public Property DeleteCompletedFilesAfterCancel() As Boolean
Get
Return m_deleteCompletedFiles
End Get
Set(ByVal value As Boolean)
m_deleteCompletedFiles = value
End Set
End Property

''' <summary>Gets or sets the size of the blocks that will be downloaded</summary>
Public Property PackageSize() As Int32
Get
Return m_packageSize
End Get
Set(ByVal value As Int32)
If value > 0 Then
m_packageSize = value
Else
Throw New InvalidOperationException("The PackageSize needs to be greather then 0")
End If
End Set
End Property

''' <summary>Gets or sets the amount of blocks that need to be downloaded before the progress speed is re-calculated. Note: setting this to a low value might decrease the accuracy</summary>
Public Property StopWatchCyclesAmount() As Int32
Get
Return m_stopWatchCycles
End Get
Set(ByVal value As Int32)
If value > 0 Then
m_stopWatchCycles = value
Else
Throw New InvalidOperationException("The StopWatchCyclesAmount needs to be greather then 0")
End If
End Set
End Property

''' <summary>Gets or sets the busy state of the FileDownloader</summary>
Public Property IsBusy() As Boolean
Get
Return m_busy
End Get
Set(ByVal value As Boolean)
If Me.IsBusy <> value Then
m_busy = value
m_canceled = Not value
If Me.IsBusy Then
m_totalProgress = 0
bgwDownloader.RunWorkerAsync()
RaiseEvent Started(Me, New EventArgs)
RaiseEvent IsBusyChanged(Me, New EventArgs)
RaiseEvent StateChanged(Me, New EventArgs)
Else
m_paused = False
bgwDownloader.CancelAsync()
RaiseEvent CancelRequested(Me, New EventArgs)
RaiseEvent StateChanged(Me, New EventArgs)
End If
End If
End Set
End Property

''' <summary>Gets or sets the pause state of the FileDownloader</summary>
Public Property IsPaused() As Boolean
Get
Return m_paused
End Get
Set(ByVal value As Boolean)
If Me.IsBusy Then
If value <> Me.IsPaused Then
m_paused = value
If Me.IsPaused Then
trigger.Reset()
RaiseEvent Paused(Me, New EventArgs)
Else
trigger.Set()
RaiseEvent Resumed(Me, New EventArgs)
End If
RaiseEvent IsPausedChanged(Me, New EventArgs)
RaiseEvent StateChanged(Me, New EventArgs)
End If
End If
End Set
End Property

''' <summary>Gets if the FileDownloader can start</summary>
Public ReadOnly Property CanStart() As Boolean
Get
Return Not Me.IsBusy
End Get
End Property

''' <summary>Gets if the FileDownloader can pause</summary>
Public ReadOnly Property CanPause() As Boolean
Get
Return Me.IsBusy And Not Me.IsPaused And Not bgwDownloader.CancellationPending
End Get
End Property

''' <summary>Gets if the FileDownloader can resume</summary>
Public ReadOnly Property CanResume() As Boolean
Get
Return Me.IsBusy And Me.IsPaused And Not bgwDownloader.CancellationPending
End Get
End Property

''' <summary>Gets if the FileDownloader can stop</summary>
Public ReadOnly Property CanStop() As Boolean
Get
Return Me.IsBusy And Not bgwDownloader.CancellationPending
End Get
End Property

''' <summary>Gets the total size of all files together. Only avaible when the FileDownloader suports progress</summary>
Public ReadOnly Property TotalSize() As Int64
Get
If Me.SupportsProgress Then
Return m_totalSize
Else
Throw New InvalidOperationException("This FileDownloader that it doesn't support progress. Modify SupportsProgress to state that it does support progress to get the total size.")
End If
End Get
End Property

''' <summary>Gets the total amount of bytes downloaded</summary>
Public ReadOnly Property TotalProgress() As Int64
Get
Return m_totalProgress
End Get
End Property

''' <summary>Gets the amount of bytes downloaded of the current file</summary>
Public ReadOnly Property CurrentFileProgress() As Int64
Get
Return m_currentFileProgress
End Get
End Property

''' <summary>Gets the total download percentage. Only avaible when the FileDownloader suports progress</summary>
Public ReadOnly Property TotalPercentage(Optional ByVal decimals As Int32 = 0) As Double
Get
If Me.SupportsProgress Then
Return Math.Round(Me.TotalProgress / Me.TotalSize * 100, decimals)
Else
Throw New InvalidOperationException("This FileDownloader that it doesn't support progress. Modify SupportsProgress to state that it does support progress.")
End If
End Get
End Property

''' <summary>Gets the percentage of the current file progress</summary>
Public ReadOnly Property CurrentFilePercentage(Optional ByVal decimals As Int32 = 0) As Double
Get
Return Math.Round(Me.CurrentFileProgress / Me.CurrentFileSize * 100, decimals)
End Get
End Property

''' <summary>Gets the current download speed in bytes</summary>
Public ReadOnly Property DownloadSpeed() As Int32
Get
Return m_currentSpeed
End Get
End Property

''' <summary>Gets the FileInfo object representing the current file</summary>
Public ReadOnly Property CurrentFile() As FileInfo
Get
Return Me.Files(m_fileNr)
End Get
End Property

''' <summary>Gets the size of the current file in bytes</summary>
Public ReadOnly Property CurrentFileSize() As Int64
Get
Return m_currentFileSize
End Get
End Property

''' <summary>Gets if the last download was canceled by the user</summary>
Private ReadOnly Property HasBeenCanceled() As Boolean
Get
Return m_canceled
End Get
End Property
#End Region

End Class
#End Region

End Namespace

sajjad_tanha20
چهارشنبه 07 فروردین 1392, 18:55 عصر
بابا مثلا اینجا برنامه نویس ها میان دیگه نه ؟
یکی نیست یه کمکی کنه ؟ یعنی هیچکی نمیدونه ؟ یعنی همه تون فقط واسه کپی کد میاین اینجا ؟
خوبه کد رو هم گذاشتم ها

harash
جمعه 25 مرداد 1392, 13:22 عصر
سورس برنامه رو بذارید تا یه نگاهی بیاندازم

matrix0151
جمعه 25 مرداد 1392, 13:28 عصر
باید add-on بسازی برایmozilla
http://blog.mozilla.org/addons/2009/01/28/how-to-develop-a-firefox-extension/

harash
جمعه 25 مرداد 1392, 13:53 عصر
کسی سورس دانلودر داره که قابلیت pause و resume هم داشته باشه؟
اگه میشه سورس رو قرار بدید.
اگر هم سورس دانلود از سرورهایی که یوزر و پسورد دارند رو هم دارید بگذارید. ممنون میشم

harash
یک شنبه 27 مرداد 1392, 09:19 صبح
یعنی واقعا هیچکی بلد نیست یه دانلود منیجر بسازه؟
خیلی جستجو کردم ولی چیزی پیدا نکردم. لطف کنید هر کسی کدی داره قرار بده. خیلی لازمش دارم.

sajjad_tanha20
دوشنبه 28 مرداد 1392, 11:16 صبح
دوستان من نرم افزارمو تکمیل کردم تنها مشکلی که هست هنوز add-on نتونستم بسازم چون از جاوا سر در نمیارم اگه کسی بلده چطور باید add-on ساخت لطفا راهنمایی کنه به سایت موزیلا هم سر زدم ( با تشکر از دوست عزیزمون matrix0151 ) اما اونجا هم چیزی حالی نشدم البته فعلا وقت کافی ندارم شایدم تونستم اما اگه یکی کمک کنه خیلی خوب میشه .
در مورد سورس برنامه باید بگم که الان نمیتونم دیگه سورسشو بذارم چون خیلی روش زحمت کشیدم مگر اینکه کسی بخواد کمک کنه
اما فایل نصبی نرم افزار رو میذارم ، لطفا منو از نظراتتون بی بهره نذارید :قلب:

دانلود نرم افزار SD Download Manager (http://s4.picofile.com/file/7899519993/Setup_SD_Download_Manager.exe.html)

ali.rk
دوشنبه 28 مرداد 1392, 14:15 عصر
دوستان به یه مشکل جدید برخوردم
اونم اینکه نمیتونم از هاست هایی که یوزر و پسورد دارن دانلود کنم
چطور میشه از این هاست ها دانلود کرد
راستی من دانلود منیجرمو با class نوشتم نه webclint و اینا

با این class :

Option Strict On : Option Explicit On

Imports System.ComponentModel
Imports System.IO
Imports System.Net

Namespace Bn.Classes

#Region "Public Class FileDownloader"
''' <summary>Class for downloading files in the background that supports info about their progress, the total progress, cancellation, pausing, and resuming. The downloads will run on a separate thread so you don't have to worry about multihreading yourself. </summary>
''' <remarks>Class FileDownloader v1.0.3, by De Dauw Jeroen - May 2009</remarks>
Public Class FileDownloader
Inherits System.Object
Implements IDisposable

#Region "Nested types"

#Region "Public Structure FileInfo"
''' <summary>Simple structure for managing file info</summary>
Public Structure FileInfo
''' <summary>The complete path of the file (directory + filename)</summary>
Public Path As String
''' <summary>The name of the file</summary>
Public Name As String

''' <summary>Create a new instance of FileInfo</summary>
''' <param name="path">The complete path of the file (directory + filename)</param>
Public Sub New(ByVal path As String)
Me.Path = path
Dim txt As New RichTextBox
txt.Text = path
Me.Name = txt.Text.Split("/"c)(txt.Text.Split("/"c).Length - 1)
End Sub
End Structure
#End Region

#Region "Private Enum [Event]"
''' <summary>Holder for events that are triggered in the background worker but need to be fired in the main thread</summary>
Private Enum [Event]
CalculationFileSizesStarted

FileSizesCalculationComplete
DeletingFilesAfterCancel

FileDownloadAttempting
FileDownloadStarted
FileDownloadStopped
FileDownloadSucceeded

ProgressChanged
End Enum
#End Region

#Region "Private Enum InvokeType"
''' <summary>Holder for the action that needs to be invoked</summary>
Private Enum InvokeType
EventRaiser
FileDownloadFailedRaiser
CalculatingFileNrRaiser
End Enum
#End Region

#End Region

#Region "Events"
''' <summary>Occurs when the file downloading has started</summary>
Public Event Started As EventHandler
''' <summary>Occurs when the file downloading has been paused</summary>
Public Event Paused As EventHandler
''' <summary>Occurs when the file downloading has been resumed</summary>
Public Event Resumed As EventHandler
''' <summary>Occurs when the user has requested to cancel the downloads</summary>
Public Event CancelRequested As EventHandler
''' <summary>Occurs when the user has requested to cancel the downloads and the cleanup of the downloaded files has started</summary>
Public Event DeletingFilesAfterCancel As EventHandler
''' <summary>Occurs when the file downloading has been canceled by the user</summary>
Public Event Canceled As EventHandler
''' <summary>Occurs when the file downloading has been completed (without canceling it)</summary>
Public Event Completed As EventHandler
''' <summary>Occurs when the file downloading has been stopped by either cancellation or completion</summary>
Public Event Stopped As EventHandler

''' <summary>Occurs when the busy state of the FileDownloader has changed</summary>
Public Event IsBusyChanged As EventHandler
''' <summary>Occurs when the pause state of the FileDownloader has changed</summary>
Public Event IsPausedChanged As EventHandler
''' <summary>Occurs when the either the busy or pause state of the FileDownloader have changed</summary>
Public Event StateChanged As EventHandler

''' <summary>Occurs when the calculation of the file sizes has started</summary>
Public Event CalculationFileSizesStarted As EventHandler
''' <summary>Occurs when the calculation of the file sizes has started</summary>
Public Event CalculatingFileSize As FileSizeCalculationEventHandler
''' <summary>Occurs when the calculation of the file sizes has been completed</summary>
Public Event FileSizesCalculationComplete As EventHandler

''' <summary>Occurs when the FileDownloader attempts to get a web response to download the file</summary>
Public Event FileDownloadAttempting As EventHandler
''' <summary>Occurs when a file download has started</summary>
Public Event FileDownloadStarted As EventHandler
''' <summary>Occurs when a file download has stopped</summary>
Public Event FileDownloadStopped As EventHandler
''' <summary>Occurs when a file download has been completed successfully</summary>
Public Event FileDownloadSucceeded As EventHandler
''' <summary>Occurs when a file download has been completed unsuccessfully</summary>
Public Event FileDownloadFailed(ByVal sender As Object, ByVal e As Exception)

''' <summary>Occurs every time a block of data has been downloaded</summary>
Public Event ProgressChanged As EventHandler
#End Region

#Region "Fields"
Public Delegate Sub FileSizeCalculationEventHandler(ByVal sender As Object, ByVal fileNumber As Int32)

Private WithEvents bgwDownloader As New BackgroundWorker
Private trigger As New Threading.ManualResetEvent(True)

' Preferences
Private m_supportsProgress, m_deleteCompletedFiles As Boolean
Private m_packageSize, m_stopWatchCycles As Int32

' State
Private m_disposed As Boolean = False
Private m_busy, m_paused, m_canceled As Boolean
Private m_currentFileProgress, m_totalProgress, m_currentFileSize As Int64
Private m_currentSpeed, m_fileNr As Int32

' Data
Private m_localDirectory As String
Private m_files As New List(Of FileInfo)
Private m_totalSize As Int64
#End Region

#Region "Constructors"
''' <summary>Create a new instance of a FileDownloader</summary>
''' <param name="supportsProgress">Optional. Boolean. Should the FileDownloader support total progress statistics?</param>
Public Sub New(Optional ByVal supportsProgress As Boolean = False)
' Set the bgw properties
bgwDownloader.WorkerReportsProgress = True
bgwDownloader.WorkerSupportsCancellation = True

' Set the default class preferences
Me.SupportsProgress = supportsProgress
Me.PackageSize = 4096
Me.StopWatchCyclesAmount = 5
Me.DeleteCompletedFilesAfterCancel = False
End Sub
#End Region

#Region "Public methods"
''' <summary>Start the downloads</summary>
Public Sub Start()
Me.IsBusy = True
End Sub

''' <summary>pause the downloads</summary>
Public Sub Pause()
Me.IsPaused = True
End Sub

''' <summary>Resume the downloads</summary>
Public Sub [Resume]()
Me.IsPaused = False
End Sub

''' <summary>Stop the downloads</summary>
Public Overloads Sub [Stop]()
Me.IsBusy = False
End Sub

''' <summary>Stop the downloads</summary>
''' <param name="deleteCompletedFiles">Required. Boolean. Indicates wether the complete downloads should be deleted</param>
Public Overloads Sub [Stop](ByVal deleteCompletedFiles As Boolean)
Me.DeleteCompletedFilesAfterCancel = deleteCompletedFiles
Me.Stop()
End Sub

''' <summary>Release the recources held by the FileDownloader</summary>
Public Sub Dispose() Implements IDisposable.Dispose
Dispose(True)
GC.SuppressFinalize(Me)
End Sub

''' <summary>Format an amount of bytes to a more readible notation with binary notation symbols</summary>
''' <param name="size">Required. Int64. The raw amount of bytes</param>
''' <param name="decimals">Optional. Int32. The amount of decimals you want to have displayed in the notation</param>
Public Shared Function FormatSizeBinary(ByVal size As Int64, Optional ByVal decimals As Int32 = 2) As String
' By De Dauw Jeroen - April 2009 - jeroen_dedauw@yahoo.com
Dim sizes() As String = {" B", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"}
Dim formattedSize As Double = size
Dim sizeIndex As Int32 = 0
While formattedSize >= 1024 And sizeIndex < sizes.Length
formattedSize /= 1024
sizeIndex += 1
End While
Return Math.Round(formattedSize, decimals).ToString & sizes(sizeIndex)
End Function

''' <summary>Format an amount of bytes to a more readible notation with decimal notation symbols</summary>
''' <param name="size">Required. Int64. The raw amount of bytes</param>
''' <param name="decimals">Optional. Int32. The amount of decimals you want to have displayed in the notation</param>
Public Shared Function FormatSizeDecimal(ByVal size As Int64, Optional ByVal decimals As Int32 = 2) As String
' By De Dauw Jeroen - April 2009 - jeroen_dedauw@yahoo.com
Dim sizes() As String = {" B", " kB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"}
Dim formattedSize As Double = size
Dim sizeIndex As Int32 = 0
While formattedSize >= 1000 And sizeIndex < sizes.Length
formattedSize /= 1000
sizeIndex += 1
End While
Return Math.Round(formattedSize, decimals).ToString & sizes(sizeIndex)
End Function
#End Region

#Region "Private/protected methods"
Private Sub bgwDownloader_DoWork() Handles bgwDownloader.DoWork
Dim fileNr As Int32 = 0

If Me.SupportsProgress Then calculateFilesSize()

If Not Directory.Exists(Me.LocalDirectory) Then Directory.CreateDirectory(Me.LocalDirectory)

While fileNr < Me.Files.Count And Not bgwDownloader.CancellationPending
m_fileNr = fileNr
downloadFile(fileNr)

If bgwDownloader.CancellationPending Then
fireEventFromBgw([Event].DeletingFilesAfterCancel)
cleanUpFiles(If(Me.DeleteCompletedFilesAfterCancel , 0, m_fileNr), If(Me.DeleteCompletedFilesAfterCancel, m_fileNr + 1, 1))
Else
fileNr += 1
End If
End While
End Sub

Private Sub fireEventFromBgw(ByVal eventName As [Event])
bgwDownloader.ReportProgress(InvokeType.EventRaise r, eventName)
End Sub

Private Sub bwgDownloader_ProgressChanged(ByVal sender As Object, ByVal e As ProgressChangedEventArgs) Handles bgwDownloader.ProgressChanged
Select Case CType(e.ProgressPercentage, InvokeType)
Case InvokeType.EventRaiser
Select Case CType(e.UserState, [Event])
Case [Event].CalculationFileSizesStarted
RaiseEvent CalculationFileSizesStarted(Me, New EventArgs)
Case [Event].FileSizesCalculationComplete
RaiseEvent FileSizesCalculationComplete(Me, New EventArgs)
Case [Event].DeletingFilesAfterCancel
RaiseEvent DeletingFilesAfterCancel(Me, New EventArgs)

Case [Event].FileDownloadAttempting
RaiseEvent FileDownloadAttempting(Me, New EventArgs)
Case [Event].FileDownloadStarted
RaiseEvent FileDownloadStarted(Me, New EventArgs)
Case [Event].FileDownloadStopped
RaiseEvent FileDownloadStopped(Me, New EventArgs)
Case [Event].FileDownloadSucceeded
RaiseEvent FileDownloadSucceeded(Me, New EventArgs)
Case [Event].ProgressChanged
RaiseEvent ProgressChanged(Me, New EventArgs)
End Select
Case InvokeType.FileDownloadFailedRaiser
RaiseEvent FileDownloadFailed(Me, CType(e.UserState, Exception))
Case InvokeType.CalculatingFileNrRaiser
RaiseEvent CalculatingFileSize(Me, CInt(e.UserState))
End Select
End Sub

Private Sub cleanUpFiles(Optional ByVal start As Int32 = 0, Optional ByVal length As Int32 = -1)
Dim last As Int32 = If(length < 0, Me.Files.Count - 1, start + length - 1)
For fileNr As Int32 = start To last
Dim fullPath As String = Me.LocalDirectory & "\" & Me.Files(fileNr).Name
If IO.File.Exists(fullPath) Then IO.File.Delete(fullPath)
Next
End Sub

Private Sub calculateFilesSize()
fireEventFromBgw([Event].CalculationFileSizesStarted)
m_totalSize = 0

For fileNr As Int32 = 0 To Me.Files.Count - 1
bgwDownloader.ReportProgress(InvokeType.Calculatin gFileNrRaiser, fileNr + 1)
Try
Dim webReq As HttpWebRequest = CType(Net.WebRequest.Create(Me.Files(fileNr).Path) , HttpWebRequest)
Dim webResp As HttpWebResponse = CType(webReq.GetResponse, HttpWebResponse)
m_totalSize += webResp.ContentLength
webResp.Close()
Catch ex As Exception
End Try
Next
fireEventFromBgw([Event].FileSizesCalculationComplete)
End Sub

Private Sub downloadFile(ByVal fileNr As Int32)
m_currentFileSize = 0
fireEventFromBgw([Event].FileDownloadAttempting)

Dim file As FileInfo = Me.Files(fileNr)
Dim size As Int64 = 0

Dim readBytes(Me.PackageSize - 1) As Byte
Dim currentPackageSize As Int32
Dim writer As New FileStream(Me.LocalDirectory & "\" & file.Name, IO.FileMode.Create)
Dim speedTimer As New Stopwatch
Dim readings As Int32 = 0
Dim exc As Exception

Dim webReq As HttpWebRequest
Dim webResp As HttpWebResponse

Try
webReq = CType(Net.WebRequest.Create(Me.Files(fileNr).Path) , HttpWebRequest)
webResp = CType(webReq.GetResponse, HttpWebResponse)

size = webResp.ContentLength
Catch ex As Exception
exc = ex
End Try

m_currentFileSize = size
fireEventFromBgw([Event].FileDownloadStarted)

If exc IsNot Nothing Then
bgwDownloader.ReportProgress(InvokeType.FileDownlo adFailedRaiser, exc)
Else
m_currentFileProgress = 0
While m_currentFileProgress < size
If bgwDownloader.CancellationPending Then
speedTimer.Stop()
writer.Close()
webResp.Close()
Exit Sub
End If
trigger.WaitOne()

speedTimer.Start()

currentPackageSize = webResp.GetResponseStream().Read(readBytes, 0, Me.PackageSize)
m_currentFileProgress += currentPackageSize
m_totalProgress += currentPackageSize
fireEventFromBgw([Event].ProgressChanged)

writer.Write(readBytes, 0, currentPackageSize)
readings += 1

If readings >= Me.StopWatchCyclesAmount Then
m_currentSpeed = CInt(Me.PackageSize * StopWatchCyclesAmount * 1000 / (speedTimer.ElapsedMilliseconds + 1))
speedTimer.Reset()
readings = 0
End If
End While

speedTimer.Stop()
writer.Close()
webResp.Close()
fireEventFromBgw([Event].FileDownloadSucceeded)
End If
fireEventFromBgw([Event].FileDownloadStopped)
End Sub

Private Sub bgwDownloader_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles bgwDownloader.RunWorkerCompleted
Me.IsPaused = False
m_busy = False

If Me.HasBeenCanceled Then
RaiseEvent Canceled(Me, New EventArgs)
Else
RaiseEvent Completed(Me, New EventArgs)
End If

RaiseEvent Stopped(Me, New EventArgs)
RaiseEvent IsBusyChanged(Me, New EventArgs)
RaiseEvent StateChanged(Me, New EventArgs)
End Sub

Protected Overridable Sub Dispose(ByVal disposing As Boolean)
If Not m_disposed Then
If disposing Then
' Free other state (managed objects)
bgwDownloader.Dispose()
End If
' Free your own state (unmanaged objects)
' Set large fields to null
Me.Files = Nothing
End If
m_disposed = True
End Sub
#End Region

#Region "Properties"
''' <summary>Gets or sets the list of files to download</summary>
Public Property Files() As List(Of FileInfo)
Get
Return m_files
End Get
Set(ByVal value As List(Of FileInfo))
If Me.IsBusy Then
Throw New InvalidOperationException("You can not change the file list during the download")
Else
If Me.Files IsNot value Then m_files = value
End If
End Set
End Property

''' <summary>Gets or sets the local directory in which files will be stored</summary>
Public Property LocalDirectory() As String
Get
Return m_localDirectory
End Get
Set(ByVal value As String)
If value <> Me.LocalDirectory Then
m_localDirectory = value
End If
End Set
End Property

''' <summary>Gets or sets if the FileDownloader should support total progress statistics. Note that when enabled, the FileDownloader will have to get the size of each file before starting to download them, which can delay the operation.</summary>
Public Property SupportsProgress() As Boolean
Get
Return m_supportsProgress
End Get
Set(ByVal value As Boolean)
If Me.IsBusy Then
Throw New InvalidOperationException("You can not change the SupportsProgress property during the download")
Else
m_supportsProgress = value
End If
End Set
End Property

''' <summary>Gets or sets if when the download process is cancelled the complete downloads should be deleted</summary>
Public Property DeleteCompletedFilesAfterCancel() As Boolean
Get
Return m_deleteCompletedFiles
End Get
Set(ByVal value As Boolean)
m_deleteCompletedFiles = value
End Set
End Property

''' <summary>Gets or sets the size of the blocks that will be downloaded</summary>
Public Property PackageSize() As Int32
Get
Return m_packageSize
End Get
Set(ByVal value As Int32)
If value > 0 Then
m_packageSize = value
Else
Throw New InvalidOperationException("The PackageSize needs to be greather then 0")
End If
End Set
End Property

''' <summary>Gets or sets the amount of blocks that need to be downloaded before the progress speed is re-calculated. Note: setting this to a low value might decrease the accuracy</summary>
Public Property StopWatchCyclesAmount() As Int32
Get
Return m_stopWatchCycles
End Get
Set(ByVal value As Int32)
If value > 0 Then
m_stopWatchCycles = value
Else
Throw New InvalidOperationException("The StopWatchCyclesAmount needs to be greather then 0")
End If
End Set
End Property

''' <summary>Gets or sets the busy state of the FileDownloader</summary>
Public Property IsBusy() As Boolean
Get
Return m_busy
End Get
Set(ByVal value As Boolean)
If Me.IsBusy <> value Then
m_busy = value
m_canceled = Not value
If Me.IsBusy Then
m_totalProgress = 0
bgwDownloader.RunWorkerAsync()
RaiseEvent Started(Me, New EventArgs)
RaiseEvent IsBusyChanged(Me, New EventArgs)
RaiseEvent StateChanged(Me, New EventArgs)
Else
m_paused = False
bgwDownloader.CancelAsync()
RaiseEvent CancelRequested(Me, New EventArgs)
RaiseEvent StateChanged(Me, New EventArgs)
End If
End If
End Set
End Property

''' <summary>Gets or sets the pause state of the FileDownloader</summary>
Public Property IsPaused() As Boolean
Get
Return m_paused
End Get
Set(ByVal value As Boolean)
If Me.IsBusy Then
If value <> Me.IsPaused Then
m_paused = value
If Me.IsPaused Then
trigger.Reset()
RaiseEvent Paused(Me, New EventArgs)
Else
trigger.Set()
RaiseEvent Resumed(Me, New EventArgs)
End If
RaiseEvent IsPausedChanged(Me, New EventArgs)
RaiseEvent StateChanged(Me, New EventArgs)
End If
End If
End Set
End Property

''' <summary>Gets if the FileDownloader can start</summary>
Public ReadOnly Property CanStart() As Boolean
Get
Return Not Me.IsBusy
End Get
End Property

''' <summary>Gets if the FileDownloader can pause</summary>
Public ReadOnly Property CanPause() As Boolean
Get
Return Me.IsBusy And Not Me.IsPaused And Not bgwDownloader.CancellationPending
End Get
End Property

''' <summary>Gets if the FileDownloader can resume</summary>
Public ReadOnly Property CanResume() As Boolean
Get
Return Me.IsBusy And Me.IsPaused And Not bgwDownloader.CancellationPending
End Get
End Property

''' <summary>Gets if the FileDownloader can stop</summary>
Public ReadOnly Property CanStop() As Boolean
Get
Return Me.IsBusy And Not bgwDownloader.CancellationPending
End Get
End Property

''' <summary>Gets the total size of all files together. Only avaible when the FileDownloader suports progress</summary>
Public ReadOnly Property TotalSize() As Int64
Get
If Me.SupportsProgress Then
Return m_totalSize
Else
Throw New InvalidOperationException("This FileDownloader that it doesn't support progress. Modify SupportsProgress to state that it does support progress to get the total size.")
End If
End Get
End Property

''' <summary>Gets the total amount of bytes downloaded</summary>
Public ReadOnly Property TotalProgress() As Int64
Get
Return m_totalProgress
End Get
End Property

''' <summary>Gets the amount of bytes downloaded of the current file</summary>
Public ReadOnly Property CurrentFileProgress() As Int64
Get
Return m_currentFileProgress
End Get
End Property

''' <summary>Gets the total download percentage. Only avaible when the FileDownloader suports progress</summary>
Public ReadOnly Property TotalPercentage(Optional ByVal decimals As Int32 = 0) As Double
Get
If Me.SupportsProgress Then
Return Math.Round(Me.TotalProgress / Me.TotalSize * 100, decimals)
Else
Throw New InvalidOperationException("This FileDownloader that it doesn't support progress. Modify SupportsProgress to state that it does support progress.")
End If
End Get
End Property

''' <summary>Gets the percentage of the current file progress</summary>
Public ReadOnly Property CurrentFilePercentage(Optional ByVal decimals As Int32 = 0) As Double
Get
Return Math.Round(Me.CurrentFileProgress / Me.CurrentFileSize * 100, decimals)
End Get
End Property

''' <summary>Gets the current download speed in bytes</summary>
Public ReadOnly Property DownloadSpeed() As Int32
Get
Return m_currentSpeed
End Get
End Property

''' <summary>Gets the FileInfo object representing the current file</summary>
Public ReadOnly Property CurrentFile() As FileInfo
Get
Return Me.Files(m_fileNr)
End Get
End Property

''' <summary>Gets the size of the current file in bytes</summary>
Public ReadOnly Property CurrentFileSize() As Int64
Get
Return m_currentFileSize
End Get
End Property

''' <summary>Gets if the last download was canceled by the user</summary>
Private ReadOnly Property HasBeenCanceled() As Boolean
Get
Return m_canceled
End Get
End Property
#End Region

End Class
#End Region

End Namespace

داداش این همه کد رو خودت نوشتی یا از help میکروسافت کپی کریدی (اگه کردی لینکش رو می دی ؟)

ali.rk
دوشنبه 28 مرداد 1392, 14:29 عصر
یعنی واقعا هیچکی بلد نیست یه دانلود منیجر بسازه؟
خیلی جستجو کردم ولی چیزی پیدا نکردم. لطف کنید هر کسی کدی داره قرار بده. خیلی لازمش دارم.
بلد نیستم ولی اگر سورس می خواین ( :عصبانی: )


http://www.codeproject.com/Articles/35787/VB-NET-Background-File-Downloader

http://www.codeproject.com/Articles/17979/Downloading-Files-in-NET-With-All-Information-Prog

(ادمین جان ببخش واسه قانون شکنسی دیگه حال دانلود و آپلود نداشتم (خواستم بقیه هم با سایت codeproject آشنا بشن ))

sajjad_tanha20
دوشنبه 28 مرداد 1392, 14:47 عصر
نه حاجی زنگ زدم از بیل گیتس پرسیدم :بامزه:
علی جان همونطور که بالا گفتم این کلاس دانلودر هستش که با متد مولتی ترد اول فایل دانلودی رو تیکه تیکه میکنه بعد شروع به دانلود میکنه که خودم نوشتم ( البته همشو یه جا ننوشتم این کد دو ماه طول کشید تا تکمیل بشه ، و هر خطشو چندبار نوشتم جواب نداده از اول نوشتم و... اگرم به خاطر توضیحاتش میگی تو کدپروجکت هم کمک خواسته بودم واسه همین توضیحات انگلیسی بهش اضافه کردم واسه تفهیم مطلب که اونجا هم کمکی نکردن مثل اینجا ( اونجا اسمم light25360 هستش )
البته الان این کد خیلی فرق کرده همه چیزشو عوض کردم چون این کد در بعضی مواقع فریز میشد . پروژمو بالا گذاشتم که با .Net framework 4 هستش ، خوشحال میشم اگه یه تست بزنی و اشکالات یا پیشنهادات رو بهم بگی

sajjad_tanha20
چهارشنبه 06 شهریور 1392, 13:17 عصر
دوستان نرم افزار مدیریت دانلودی که ساختم ( SD Download Manager ) (با اینکه هنوز کامل کامل نیست ) در سایت سافت گذر ثبت شد . با اجازه ادمین محترم لینکشو میذارم اما اگه نادرست تشخیص دادین میتونین پاک کنین

مشاهده در سافت گذر (http://www.softgozar.com/WebPage/RegisterSoftware.aspx?SoftwareId=2859&Title=%D9%85%D8%AF%DB%8C%D8%B1%DB%8C%D8%AA%20%D8%A F%D8%A7%D9%86%D9%84%D9%88%D8%AF%20SD%20Download%20 Manager)

با تشکر

ali.rk
چهارشنبه 06 شهریور 1392, 17:44 عصر
سجاد چه کردی ؟
مدیریت دانلود SD Download Manager این نرم افزار با تکنیک قطعه قطعه کردن فایل ها و دانلود جداگانه قطعه ها و همچنین استفاده از تکنولوژی HTTPWebRequest موجب افزایش سرعت دانلود شده و از افت سرعت مرور و گشت و گذار در اینترنت توسط مرورگرها یا دیگر نرم افزارها جلوگیری میکند ( سرعت اینترنتو موقع دانلود کم نمیکنه ) قلبلیت های کلیدی نرم افزار :

- پشتیبانی از 2 زبان انگلیسی و فارسی

- پشتیبانی از تمامی نسخه های سیستم عامل ویندوز

- قابلیت ادامه دانلود های نیمه تمام از جایی که ارتباط اینترنتی شما بنا به دلایلی قطع شده است

- قابلیت زمانبندی دانلود ها

- شروع دانلود بلافاصله پس از کپی کردن لینک دانلود ( جهت شروع دانلود کافیه لینک دانلود رو کپی کنین )

- محدود کردن شروع خودکار دانلود به بعضی از فرمت های خاص

- شروع نرم افزار و دانلود در استارت آپ ویندوز

- نصب سریع و آسان نرم افزار

- افزایش پنج برابری سرعت دانلود بر اساس جدیدترین تکنیک ها

- بررسی لینک دانلود جهت یافتن سریعترین لینک و سالم بودن فایل قبل از دانلود

- پخش صدای دلخواه به هنگام پایان یا خطای دانلود

- و قابلیت های فراوان دیگر که به هنگام استفاده خواهید دید



توجه : این نرم افزار بر اساس Net Framework 4. می باشد به همین دلیل باید نرم افزار راه انداز Net Framework 4. بر روی سیستم شما نصب باشید ولی اگر نصب نیست در هنگام نصب نرم افزار ، این راه انداز به صورت خودکار از اینترنت دانلود و نصب خواهد شد.

آدرس:
تلفن:
فاکس:
تلفن همراه: 09368685696
وب سایت: http://sddl.persianblog.ir

Mani_rf
چهارشنبه 06 شهریور 1392, 18:24 عصر
- پشتیبانی از تمامی نسخه های سیستم عامل ویندوز


توجه : این نرم افزار بر اساس Net Framework 4. می باشد به همین دلیل باید نرم افزار راه انداز Net Framework 4. بر روی سیستم شما نصب باشید ولی اگر نصب نیست در هنگام نصب نرم افزار ، این راه انداز به صورت خودکار از اینترنت دانلود و نصب خواهد شد.


حالا که این دوستمون این بخش رو اینجا کپی کرد فکر میکنم لازمه این نکته رو بگم.
این دوتا جمله باهم تناقض دارن دوست من. .Net Framework 4 روی Windows XP SP3 به بالا نصب میشه. یعنی عملا 2تا نسخه از XP (که تو کشورمون مخصوصا تو اداره ها هنوز زیاد استفاده میشه) و ME و 2000 و 98 کلا پشتیبانی نمیشه.

اطلاعات بیشتر (http://www.microsoft.com/en-us/download/details.aspx?id=17851#)

sajjad_tanha20
پنج شنبه 07 شهریور 1392, 09:40 صبح
ali.rk جان : فدات دادا هیچی دادا فقط سعی کردم یه دانلود منیجر بسازم :چشمک:

Mani_rf عزیز : درسته دادا ، ولی فکر کنم دیگه همه از ویندوز xp به بالا استفاده می کنن و عمر سیستم عامل های قدیمی دیگه تموم شده البته میتونم به Net Framework 2. کاهش بدم اما اونوقت قابلیت هایی که تو ویندوز ویستا به بالا هست کار نمیکنن . :لبخندساده:

sajjad_tanha20
پنج شنبه 07 شهریور 1392, 09:45 صبح
راستی دوستان یه مشکلی هم که چند وقته باهاش دارم سروکله میزنم مشکل استارت آپ ویندوز 8 هست که با اینکه نرم افزار تو لیست رجیستری ، قسمت ران آدرس دهی شده و از تسک منیجر هم که نگاه میکنی می بینی تو استارت آپ ویندوز هست با این حال موقع بالا اومدن ویندوز 8 اجرا نمیشه .
دوستان اگه کسی چیزی در مورد استارت آپ ویندوز 8 میدونه که میتونه این مشکل رو حل کنه خوشحال میشم بگه .

مرسی

sajjad_tanha20
یک شنبه 31 شهریور 1392, 03:57 صبح
با جستجویی که تو نت کردم فهمیدم این مشکل رو خیلی از نرم افزارها با ویندوز 8 دارن و راه حلشم پیدا کردم ، فقط باید یه تیک رو بردارین تا این مشکل حل بشه که به صورت تصویری تو وبلاگم گذاشتم
با اجازه ادمین محترم لینک آموزش رو میذارم اما اگه نادرست تشخیص دادین میتونین لینک رو پاک کنین ، مرسی :قلب:

آموزش رفع مشکل استارت آپ در ویندوز 8 (http://sddl.persianblog.ir/post/5/)

farhad-s
یک شنبه 17 فروردین 1393, 16:40 عصر
سلام آقا سجاد من یه برنامه نوشتم برای دانلود که قابلیت ادامه هم داره . میخواستم بدونم در صورتی که اینترنت قطع بشه و یا timeout بده چطوری میشه بعد از اتصال مجدد اینترنت بطور اتوماتیک برنامه دانلود رو ادامه بده. مثل برنامه خودت
با تشکر

sajjad_tanha20
یک شنبه 17 فروردین 1393, 17:17 عصر
سلام آقا سجاد من یه برنامه نوشتم برای دانلود که قابلیت ادامه هم داره . میخواستم بدونم در صورتی که اینترنت قطع بشه و یا timeout بده چطوری میشه بعد از اتصال مجدد اینترنت بطور اتوماتیک برنامه دانلود رو ادامه بده. مثل برنامه خودت
با تشکر

سلام
برای اینکار روش های مختلفی مثل تعریف تسک برای ویندوز یا راحت تر از اون استفاده از یه تایمر هست که هر چند ثانیه یکبار وضعیت اینترنت رو با کد زیر بررسی کنه و اگه اینترنت وصل بود ادامه دانلود رو انجام بده :


Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If My.Computer.Network.IsAvailable = True Then
'کد نرم افزارت برای ادامه دانلود
End If
End Sub

sajjad_tanha20
یک شنبه 17 فروردین 1393, 18:10 عصر
دوستان ورژن جدید نرم افزار با قابلیت های جدید و 32 کانکشن همزمان آماده شد .

برای توضیحات بیشتر و دانلود نرم افزار به وبلاگ نرم افزار مراجعه کنید : وبلاگ نرم افزار (http://sddl.persianblog.ir/)

farhad-s
دوشنبه 18 فروردین 1393, 01:18 صبح
سلام
برای اینکار روش های مختلفی مثل تعریف تسک برای ویندوز یا راحت تر از اون استفاده از یه تایمر هست که هر چند ثانیه یکبار وضعیت اینترنت رو با کد زیر بررسی کنه و اگه اینترنت وصل بود ادامه دانلود رو انجام بده :


Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If My.Computer.Network.IsAvailable = True Then
'کد نرم افزارت برای ادامه دانلود
End If
End Sub

این دستوری که نوشتی در مورد اتصال به اینترنت جواب نمیده. اگر شبکه متصل باشه و به اینترنت هم وصل نباشی عمل میکنه
خودت تو برنامه از چه دستوری استفاده کردی . من پینگ سایت رو با یک تایمر میگیرم تا اتصال به اینترنت رو چک کنم آیا راه بهتری هست .

sajjad_tanha20
دوشنبه 18 فروردین 1393, 02:32 صبح
در این شرایط بهترین راهی که میتونی انجام بدی همون پینگ گرفتن از یه سایت یا هاست سبک هستش و یا اینکه میتونی از همون کدی که گذاشتم استفاده کنی ولی برای Time out یه دستور دیگه بنویسی که موقع تایم اوت مثلا دوباره تلاش کنه یا ارور تایم اوت بده و... اگه هم به کدش نیاز داشتی بگو تا بذارم برات دادا

farhad-s
سه شنبه 19 فروردین 1393, 11:15 صبح
در این شرایط بهترین راهی که میتونی انجام بدی همون پینگ گرفتن از یه سایت یا هاست سبک هستش و یا اینکه میتونی از همون کدی که گذاشتم استفاده کنی ولی برای Time out یه دستور دیگه بنویسی که موقع تایم اوت مثلا دوباره تلاش کنه یا ارور تایم اوت بده و... اگه هم به کدش نیاز داشتی بگو تا بذارم برات دادا

دستور پینگ رو میدونم اینه
If My.Computer.Network.Ping(URL) Then
Return True
Else
Return False
End If
ولی مشکل اینجاست که هر تایم اوت باعث توقف دانلود نمیشه بعضی رو برنامه ادامه میده ولی رو بعضی از تایم اوتها دانلود متوقف میشه
بنابراین روی هر تایم اوتی نمیشه برنامه رو متوقف و سپس ادامه داد. باید ببینم چه موقعی دیتا دریافت نمیشه اون وقت دستور قطع دانلود و سپس ادامه رو به برنامه بدم
شما چیزی به ذهنت میرسه

sajjad_tanha20
پنج شنبه 21 فروردین 1393, 14:38 عصر
از webexception استفاده کن و با کد status تایم اوت برنامه ات رو تکمیل کن مثل این :







try
'کدت واسه دانلود
Catch ex As WebException
If ex.Status = WebExceptionStatus.Timeout Then
'کدی که باید موقع تایم اوت اجرا بشه
End If
End try