C# 클래스 Yea.IO.FileInfoExtensions

Extension methods for System.IO.FileInfo
파일 보기 프로젝트 열기: OxPatient/Rule-Engine

공개 메소드들

메소드 설명
CompareTo ( this file1, FileInfo file2 ) : bool

Compares two files against one another

DriveInfo ( this file ) : DriveInfo

Gets the drive information for a file

Execute ( this file, ProcessStartInfo info ) : Process

Executes the file

Execute ( this file, string arguments = "", string domain = "", string user = "", string password = "", ProcessWindowStyle windowStyle = ProcessWindowStyle.Normal, string workingDirectory = "" ) : Process

Executes the file

Read ( this file ) : string

Reads a file to the end as a string

ReadBinary ( this file ) : byte[]

Reads a file to the end and returns a binary array

Save ( this file, byte content, FileMode mode = FileMode.Create ) : FileInfo

Saves a byte array to a file

Save ( this file, string content, FileMode mode = FileMode.Create, Encoding encodingUsing = null ) : FileInfo

Saves a string to a file

SaveAsync ( this file, byte content, AsyncCallback callBack, object stateObject, FileMode mode = FileMode.Create ) : FileInfo

Saves a byte array to a file (asynchronously)

SaveAsync ( this file, string content, AsyncCallback callBack, object stateObject, FileMode mode = FileMode.Create, Encoding encodingUsing = null ) : FileInfo

Saves a string to a file (asynchronously)

SetAttributes ( this file, FileAttributes attributes ) : FileInfo

Sets the attributes of a file

메소드 상세

CompareTo() 공개 정적인 메소드

Compares two files against one another
public static CompareTo ( this file1, FileInfo file2 ) : bool
file1 this First file
file2 System.IO.FileInfo Second file
리턴 bool

DriveInfo() 공개 정적인 메소드

Gets the drive information for a file
public static DriveInfo ( this file ) : DriveInfo
file this The file to get the drive info of
리턴 System.IO.DriveInfo

Execute() 공개 정적인 메소드

Executes the file
public static Execute ( this file, ProcessStartInfo info ) : Process
file this File to execute
info System.Diagnostics.ProcessStartInfo Info used to execute the file
리턴 System.Diagnostics.Process

Execute() 공개 정적인 메소드

Executes the file
public static Execute ( this file, string arguments = "", string domain = "", string user = "", string password = "", ProcessWindowStyle windowStyle = ProcessWindowStyle.Normal, string workingDirectory = "" ) : Process
file this File to execute
arguments string Arguments sent to the executable
domain string Domain of the user
user string User to run the file as
password string Password of the user
windowStyle ProcessWindowStyle Window style
workingDirectory string Working directory
리턴 System.Diagnostics.Process

Read() 공개 정적인 메소드

Reads a file to the end as a string
public static Read ( this file ) : string
file this File to read
리턴 string

ReadBinary() 공개 정적인 메소드

Reads a file to the end and returns a binary array
public static ReadBinary ( this file ) : byte[]
file this File to open
리턴 byte[]

Save() 공개 정적인 메소드

Saves a byte array to a file
public static Save ( this file, byte content, FileMode mode = FileMode.Create ) : FileInfo
file this File to save to
content byte Content to save to the file
mode FileMode Mode for saving the file (defaults to Create)
리턴 System.IO.FileInfo

Save() 공개 정적인 메소드

Saves a string to a file
public static Save ( this file, string content, FileMode mode = FileMode.Create, Encoding encodingUsing = null ) : FileInfo
file this File to save to
content string Content to save to the file
mode FileMode Mode for saving the file (defaults to Create)
encodingUsing System.Text.Encoding Encoding that the content is using (defaults to ASCII)
리턴 System.IO.FileInfo

SaveAsync() 공개 정적인 메소드

Saves a byte array to a file (asynchronously)
public static SaveAsync ( this file, byte content, AsyncCallback callBack, object stateObject, FileMode mode = FileMode.Create ) : FileInfo
file this File to save to
content byte Content to save to the file
callBack AsyncCallback Call back function
stateObject object State object
mode FileMode Mode for saving the file (defaults to Create)
리턴 System.IO.FileInfo

SaveAsync() 공개 정적인 메소드

Saves a string to a file (asynchronously)
public static SaveAsync ( this file, string content, AsyncCallback callBack, object stateObject, FileMode mode = FileMode.Create, Encoding encodingUsing = null ) : FileInfo
file this File to save to
content string Content to save to the file
callBack AsyncCallback Call back function
stateObject object State object
mode FileMode Mode for saving the file (defaults to Create)
encodingUsing System.Text.Encoding Encoding that the content is using (defaults to ASCII)
리턴 System.IO.FileInfo

SetAttributes() 공개 정적인 메소드

Sets the attributes of a file
public static SetAttributes ( this file, FileAttributes attributes ) : FileInfo
file this File
attributes FileAttributes Attributes to set
리턴 System.IO.FileInfo