C# Class Vuzit.Base

Base web client class.
Afficher le fichier Open project: vuzit/vuzit.net

Méthodes publiques

Méthode Description
ReadHttpResponse ( HttpWebResponse response ) : string

Loads a web response into a string.

UnixTimeStampToDateTime ( double unixTimeStamp ) : System.DateTime

Converts a Unix timestamp to a DateTime instance.

Méthodes protégées

Méthode Description
NodeValue ( XmlNode node, string key ) : string

Returns the value of a child node.

NodeValueDouble ( XmlNode node, string key ) : double

Returns the double value of a child node or -1 if none.

NodeValueInt ( XmlNode node, string key ) : int

Returns the integer value of a child node or -1 if none.

ParametersToUrl ( string baseUrl, OptionList parameters ) : string

Changes an array (hash table) of parameters to a url.

PostParameters ( OptionList options, string method, string id ) : OptionList

Returns the default HTTP post parameters array.

UploadFile ( Stream fileStream, string url, string fileName, string fileFormName, string contentType, CookieContainer cookies ) : string

Uploads a file by HTTP POST. Code adapted from this project: http://www.codeproject.com/KB/cs/uploadfileex.aspx

WebRequestBuild ( string url ) : HttpWebRequest

Returns a web request.

Method Details

NodeValue() protected static méthode

Returns the value of a child node.
protected static NodeValue ( XmlNode node, string key ) : string
node System.Xml.XmlNode
key string
Résultat string

NodeValueDouble() protected static méthode

Returns the double value of a child node or -1 if none.
protected static NodeValueDouble ( XmlNode node, string key ) : double
node System.Xml.XmlNode
key string
Résultat double

NodeValueInt() protected static méthode

Returns the integer value of a child node or -1 if none.
protected static NodeValueInt ( XmlNode node, string key ) : int
node System.Xml.XmlNode
key string
Résultat int

ParametersToUrl() protected static méthode

Changes an array (hash table) of parameters to a url.
protected static ParametersToUrl ( string baseUrl, OptionList parameters ) : string
baseUrl string
parameters OptionList
Résultat string

PostParameters() protected static méthode

Returns the default HTTP post parameters array.
protected static PostParameters ( OptionList options, string method, string id ) : OptionList
options OptionList
method string
id string
Résultat OptionList

ReadHttpResponse() public static méthode

Loads a web response into a string.
public static ReadHttpResponse ( HttpWebResponse response ) : string
response System.Net.HttpWebResponse
Résultat string

UnixTimeStampToDateTime() public static méthode

Converts a Unix timestamp to a DateTime instance.
public static UnixTimeStampToDateTime ( double unixTimeStamp ) : System.DateTime
unixTimeStamp double
Résultat System.DateTime

UploadFile() protected static méthode

Uploads a file by HTTP POST. Code adapted from this project: http://www.codeproject.com/KB/cs/uploadfileex.aspx
protected static UploadFile ( Stream fileStream, string url, string fileName, string fileFormName, string contentType, CookieContainer cookies ) : string
fileStream Stream
url string URL of the request.
fileName string Name of the file.
fileFormName string Form file name.
contentType string File content type.
cookies System.Net.CookieContainer Cookies for request.
Résultat string

WebRequestBuild() protected static méthode

Returns a web request.
protected static WebRequestBuild ( string url ) : HttpWebRequest
url string
Résultat System.Net.HttpWebRequest