C# Class NntpClient.Client

Connects & performs operations on a usenet server.
Inheritance: IDisposable
Afficher le fichier Open project: strider-/NntpClient

Méthodes publiques

Méthode Description
ArticleExists ( string messageId ) : bool

Gets whether or not the article is available to download.

ArticleExists ( ulong articleId ) : bool

Gets whether or not the article is available to download.

Authenticate ( string user, string pass ) : void

Authenticates credentials against the current server.

Client ( ) : System

Creates a new intance of the client.

Close ( ) : ConnectionResult

Closes the connection & returns the statistics of the session.

Connect ( string hostname, int port, bool ssl ) : void

Opens a connection to the given usenet server on the specified port, and whether or not to use ssl.

Date ( ) : System.DateTime

Gets the current UTC date/time on the server.

Dispose ( ) : void

Closes the connection & disposes of managed resources.

GetArticle ( string messageId, bool bodyOnly = false ) : Article

Downloads an article from usenet with the given ID. Returns null if the article could not be found.

GetArticle ( ulong articleId, bool bodyOnly = false ) : Article

Downloads an article from usenet with the given ID. Returns null if the article could not be found.

GetGroups ( ) : IEnumerable

Returns a collection of available usenet groups.

GetHeaders ( string messageId ) : string>.Dictionary

Fetches only the headers of a message with the given message ID.

GetHeaders ( ulong articleId ) : string>.Dictionary

Fetches only the headers of a message with the given article ID.

GetOverviewFormat ( ) : IEnumerable

Fetches all overview fields supported by the server as a list.

GetXOverview ( ulong articleStart, ulong articleEnd ) : IEnumerable

Fetches overview database information from a group within a given range of article ids. A call to SetGroup must be made before calling this method or it will fail.

SetGroup ( string groupName ) : Group

Sets the current usenet group pointer.

SetGroup ( Group group ) : bool

Sets the current usenet group pointer.

Private Methods

Méthode Description
CleanUp ( ) : void
ProcessArticle ( ServerReply result, bool bodyOnly ) : Article
ReadHeader ( ) : string>.Dictionary
SetMode ( string mode ) : void

Method Details

ArticleExists() public méthode

Gets whether or not the article is available to download.
public ArticleExists ( string messageId ) : bool
messageId string Message-ID of the article
Résultat bool

ArticleExists() public méthode

Gets whether or not the article is available to download.
public ArticleExists ( ulong articleId ) : bool
articleId ulong
Résultat bool

Authenticate() public méthode

Authenticates credentials against the current server.
public Authenticate ( string user, string pass ) : void
user string Usenet username
pass string Usenet password
Résultat void

Client() public méthode

Creates a new intance of the client.
public Client ( ) : System
Résultat System

Close() public méthode

Closes the connection & returns the statistics of the session.
public Close ( ) : ConnectionResult
Résultat ConnectionResult

Connect() public méthode

Opens a connection to the given usenet server on the specified port, and whether or not to use ssl.
public Connect ( string hostname, int port, bool ssl ) : void
hostname string Usenet hostname
port int Port to connect on
ssl bool Uses a secure connection if true
Résultat void

Date() public méthode

Gets the current UTC date/time on the server.
public Date ( ) : System.DateTime
Résultat System.DateTime

Dispose() public méthode

Closes the connection & disposes of managed resources.
public Dispose ( ) : void
Résultat void

GetArticle() public méthode

Downloads an article from usenet with the given ID. Returns null if the article could not be found.
public GetArticle ( string messageId, bool bodyOnly = false ) : Article
messageId string
bodyOnly bool Whether or not to pull down headers with the article or not.
Résultat Article

GetArticle() public méthode

Downloads an article from usenet with the given ID. Returns null if the article could not be found.
public GetArticle ( ulong articleId, bool bodyOnly = false ) : Article
articleId ulong
bodyOnly bool Whether or not to pull down headers with the article or not.
Résultat Article

GetGroups() public méthode

Returns a collection of available usenet groups.
public GetGroups ( ) : IEnumerable
Résultat IEnumerable

GetHeaders() public méthode

Fetches only the headers of a message with the given message ID.
public GetHeaders ( string messageId ) : string>.Dictionary
messageId string Message Id
Résultat string>.Dictionary

GetHeaders() public méthode

Fetches only the headers of a message with the given article ID.
public GetHeaders ( ulong articleId ) : string>.Dictionary
articleId ulong Article Id
Résultat string>.Dictionary

GetOverviewFormat() public méthode

Fetches all overview fields supported by the server as a list.
public GetOverviewFormat ( ) : IEnumerable
Résultat IEnumerable

GetXOverview() public méthode

Fetches overview database information from a group within a given range of article ids. A call to SetGroup must be made before calling this method or it will fail.
public GetXOverview ( ulong articleStart, ulong articleEnd ) : IEnumerable
articleStart ulong The start of the article range to pull overview information for.
articleEnd ulong The end of the article range to pull overview information for.
Résultat IEnumerable

SetGroup() public méthode

Sets the current usenet group pointer.
public SetGroup ( string groupName ) : Group
groupName string
Résultat Group

SetGroup() public méthode

Sets the current usenet group pointer.
public SetGroup ( Group group ) : bool
group Group
Résultat bool