C# Класс Encog.Util.HTTP.FormUtility

FormUtility: This class is used to construct responses to HTML forms. The class supports both standard HTML forms, as well as multipart forms.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Add ( String name, String v ) : void

Add a regular text field to either a regular or multipart form.

AddFile ( String name, String file ) : void

Add a file to a multipart form. Default mime type to application/octet-stream.

AddFile ( String name, String file, String type ) : void

Add a file to a multipart form.

Complete ( ) : void

Complete the building of the form.

Encode ( String str ) : String

Encode the specified string. This encodes all special characters.

FormUtility ( Stream os, String boundary ) : System

Prepare to access either a regular, or multipart, form.

GetBoundary ( ) : String

Generate a boundary for a multipart form.

Защищенные методы

Метод Описание
RandomString ( ) : String

Generate a random string, of a specified length. This is used to generate the multipart boundary.

Writeln ( String str ) : void

Write a string, with a carriage return and linefeed.

Приватные методы

Метод Описание
Boundary ( ) : void

Generate a multipart form boundary.

Newline ( ) : void

Create a new line by displaying a carriage return and linefeed.

Write ( String str ) : void

Write the specified string, without a carriage return and line feed.

WriteName ( String name ) : void

Write the name element for a multipart post.

Описание методов

Add() публичный Метод

Add a regular text field to either a regular or multipart form.
public Add ( String name, String v ) : void
name String The name of the field.
v String The value of the field.
Результат void

AddFile() публичный Метод

Add a file to a multipart form. Default mime type to application/octet-stream.
public AddFile ( String name, String file ) : void
name String The field name.
file String The file to attach.
Результат void

AddFile() публичный Метод

Add a file to a multipart form.
public AddFile ( String name, String file, String type ) : void
name String The field name.
file String he file to attach.
type String The mime type
Результат void

Complete() публичный Метод

Complete the building of the form.
public Complete ( ) : void
Результат void

Encode() публичный статический Метод

Encode the specified string. This encodes all special characters.
public static Encode ( String str ) : String
str String The string to encode.
Результат String

FormUtility() публичный Метод

Prepare to access either a regular, or multipart, form.
public FormUtility ( Stream os, String boundary ) : System
os Stream The stream to output to.
boundary String The boundary to be used, or null if this is /// not a multipart form.
Результат System

GetBoundary() публичный статический Метод

Generate a boundary for a multipart form.
public static GetBoundary ( ) : String
Результат String

RandomString() защищенный статический Метод

Generate a random string, of a specified length. This is used to generate the multipart boundary.
protected static RandomString ( ) : String
Результат String

Writeln() защищенный Метод

Write a string, with a carriage return and linefeed.
protected Writeln ( String str ) : void
str String The string to write.
Результат void