Gets the byte count of downloaded data.
Syntax
| Visual Basic (Declaration) | |
|---|
Public ReadOnly Property Position As Long |
| C# | |
|---|
public long Position {get;} |
| Managed Extensions for C++ | |
|---|
public: __property long get_Position(); |
| C++/CLI | |
|---|
public:
property int64 Position {
int64 get();
} |
Property Value
Returns the byte count of downloaded data. If there is no way to determine how much data to expect (ImapProgressEventArgs.Length = 0), this value will also be 0.
Example
The following example demonstrates displaying progress when getting messages.
| Visual Basic | Copy Code |
|---|
Private Sub GetTest()
' Login
Imap1.Login(Server, User, Pass)
' Get all messages in INBOX, this will cause the Progress event to be raised.
Imap1.CurrentMailbox.Get()
' Logout
Imap1.Logout()
End Sub
Private Sub Imap1_Progress(ByVal sender As Object, ByVal e As Dart.PowerTCP.Mail.ImapProgressEventArgs) Handles Imap1.Progress
ProgressBar.Minimum = 0
ProgressBar.Maximum = e.Length
ProgressBar.Value = e.Position
LblProgress.Text = "Processing message " + e.Message.Id
If e.Length = e.Position Then
LblProgress.Text = "Complete"
End If
End Sub |
| C# | Copy Code |
|---|
private void GetTest()
{
// Login
imap1.Login(Server, User, Pass);
// Get all messages in INBOX, this will cause the Progress event to be raised.
imap1.CurrentMailbox.Get();
// Logout
imap1.Logout();
}
private void imap1_Progress(object sender, Dart.PowerTCP.Mail.ImapProgressEventArgs e)
{
progressBar.Minimum = 0;
progressBar.Maximum = (int)e.Length;
progressBar.Value = (int)e.Position;
lblProgress.Text = "Processing message " + e.Message.Id;
if(e.Length == e.Position)
lblProgress.Text = "Complete";
} |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0
See Also