C# 클래스 NanoByte.Common.Native.WindowsUtils

Provides helper methods and API calls specific to the Windows platform.
파일 보기 프로젝트 열기: nano-byte/common 1 사용 예제들

공개 메소드들

메소드 설명
AreHardlinked ( [ path1, [ path2 ) : bool

Determines whether to files are hardlinked.

AttachConsole ( ) : bool

Tries to attach to a command-line console owned by the parent process.

BroadcastMessage ( int messageID ) : void

Sends a message of a specific type to all windows in the current session.

CreateHardlink ( [ sourcePath, [ targetPath ) : void

Creates a hard link between two files.

Only available on Windows 2000 or newer.

CreateSymlink ( [ sourcePath, [ targetPath ) : void

Creates a symbolic link for a file or directory.

MoveFileOnReboot ( [ sourcePath, [ destinationPath ) : void

Moves a file on the next reboot of the OS. Replaces existing files.

Useful for replacing in-use files.

RegisterApplicationRestart ( [ arguments ) : void

Registers the current application for automatic restart after updates or crashes.

RegisterWindowMessage ( [ message ) : int

Registers a new message type that can be sent to windows.

SetCurrentProcessAppID ( string appID ) : void

Sets the current process' explicit application user model ID.

The application ID is used to group related windows in the taskbar.

UnregisterApplicationRestart ( ) : void

Unregisters the current application for automatic restart after updates or crashes.

WriteAllBytes ( [ path, [ data ) : void

Writes the entire contents of a byte array to a file using the Win32 API. Existing files with the same name are overwritten.

This method works like File.WriteAllBytes, but bypasses .NET's file path validation logic.

비공개 메소드들

메소드 설명
BuildException ( int error ) : Exception

Builds a suitable Exception for a given Win32Exception.NativeErrorCode.

GetFileIndex ( [ path ) : ulong
GetNetFxDirectory ( [ version ) : string
NotifyAssocChanged ( ) : void
NotifyEnvironmentChanged ( ) : void
ReadAllBytes ( [ path ) : byte[]
SplitArgs ( [ commandLine ) : string[]

메소드 상세

AreHardlinked() 공개 정적인 메소드

Determines whether to files are hardlinked.
There was an IO problem checking the files. You have insufficient rights to check the files. Checking the files failed. This method is called on a platform other than Windows NT.
public static AreHardlinked ( [ path1, [ path2 ) : bool
path1 [ The path of the first file.
path2 [ The path of the second file.
리턴 bool

AttachConsole() 공개 정적인 메소드

Tries to attach to a command-line console owned by the parent process.
public static AttachConsole ( ) : bool
리턴 bool

BroadcastMessage() 공개 정적인 메소드

Sends a message of a specific type to all windows in the current session.
public static BroadcastMessage ( int messageID ) : void
messageID int A unique ID number used to identify the message type session-wide.
리턴 void

CreateHardlink() 공개 정적인 메소드

Creates a hard link between two files.
Only available on Windows 2000 or newer.
There was an IO problem creating the hard link. You have insufficient rights to create the hard link. The hard link creation failed. This method is called on a platform other than Windows NT.
public static CreateHardlink ( [ sourcePath, [ targetPath ) : void
sourcePath [ The path of the link to create.
targetPath [ The absolute path of the existing file to point to.
리턴 void

CreateSymlink() 공개 정적인 메소드

Creates a symbolic link for a file or directory.
There was an IO problem creating the symlink. You have insufficient rights to create the symbolic link. The symbolic link creation failed. This method is called on a platform other than Windows NT 6.0 (Vista) or newer.
public static CreateSymlink ( [ sourcePath, [ targetPath ) : void
sourcePath [ The path of the link to create.
targetPath [ The path of the existing file or directory to point to (relative to ).
리턴 void

MoveFileOnReboot() 공개 정적인 메소드

Moves a file on the next reboot of the OS. Replaces existing files.
Useful for replacing in-use files.
public static MoveFileOnReboot ( [ sourcePath, [ destinationPath ) : void
sourcePath [ The source path to move the file from.
destinationPath [ The destination path to move the file to. null to delete the file instead of moving it.
리턴 void

RegisterApplicationRestart() 공개 정적인 메소드

Registers the current application for automatic restart after updates or crashes.
is too long.
public static RegisterApplicationRestart ( [ arguments ) : void
arguments [ The command-line arguments to pass to the application on restart. Must not be empty!
리턴 void

RegisterWindowMessage() 공개 정적인 메소드

Registers a new message type that can be sent to windows.
public static RegisterWindowMessage ( [ message ) : int
message [ A unique string used to identify the message type session-wide.
리턴 int

SetCurrentProcessAppID() 공개 정적인 메소드

Sets the current process' explicit application user model ID.
The application ID is used to group related windows in the taskbar.
public static SetCurrentProcessAppID ( string appID ) : void
appID string The application ID to set.
리턴 void

UnregisterApplicationRestart() 공개 정적인 메소드

Unregisters the current application for automatic restart after updates or crashes.
public static UnregisterApplicationRestart ( ) : void
리턴 void

WriteAllBytes() 공개 정적인 메소드

Writes the entire contents of a byte array to a file using the Win32 API. Existing files with the same name are overwritten.
This method works like File.WriteAllBytes, but bypasses .NET's file path validation logic.
There was an IO problem writing the file. Write access to the file was denied. There was a problem writing the file. This method is called on a platform other than Windows.
public static WriteAllBytes ( [ path, [ data ) : void
path [ The path of the file to write to.
data [ The data to write to the file.
리턴 void