C# Класс KeePassLib.Utility.UrlUtil

A class containing various static path utility helper methods (like stripping extension from a file, etc.).
Показать файл Открыть проект

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

Метод Описание
AssemblyEquals ( string strExt, string strShort ) : bool
ConvertSeparators ( string strPath ) : string
ConvertSeparators ( string strPath, char chSeparator ) : string
EnsureTerminatingSeparator ( string strPath, bool bUrl ) : string

Ensure that a path is terminated with a directory separator character.

FileUrlToPath ( string strUrl ) : string
FilterFileName ( string strName ) : string
GetExtension ( string strPath ) : string

Get the extension of a file.

GetFileDirectory ( string strFile, bool bAppendTerminatingChar, bool bEnsureValidDirSpec ) : string

Get the directory (path) of a file name. The returned string may be terminated by a directory separator character. Example: passing C:\\My Documents\\My File.kdb in strFile and true to bAppendTerminatingChar would produce this string: C:\\My Documents\\.

GetFileInfos ( DirectoryInfo di, string strPattern, SearchOption opt ) : List
GetFileName ( string strPath ) : string

Gets the file name of the specified file (full path). Example: if strPath is C:\\My Documents\\My File.kdb the returned string is My File.kdb.

GetFilePaths ( string strDir, string strPattern, SearchOption opt ) : List
GetHost ( string strUrl ) : string

Get the host component of an URL. This method is faster and more fault-tolerant than creating an Uri object and querying its Host property.

GetQuotedAppPath ( string strPath ) : string

Test if a specified path is accessible, either in read or write mode.

GetShortestAbsolutePath ( string strPath ) : string
GetTempPath ( ) : string
GetUrlLength ( string strText, int nOffset ) : int
HideFile ( string strFile, bool bHide ) : bool
IsAbsolutePath ( string strPath ) : bool
IsUncPath ( string strPath ) : bool
MakeAbsolutePath ( string strBaseFile, string strTargetFile ) : string
MakeRelativePath ( string strBaseFile, string strTargetFile ) : string
RemoveScheme ( string strUrl ) : string
StripExtension ( string strPath ) : string

Strip the extension of a file.

UnhideFile ( string strFile ) : bool

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

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

public static AssemblyEquals ( string strExt, string strShort ) : bool
strExt string
strShort string
Результат bool

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

public static ConvertSeparators ( string strPath ) : string
strPath string
Результат string

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

public static ConvertSeparators ( string strPath, char chSeparator ) : string
strPath string
chSeparator char
Результат string

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

Ensure that a path is terminated with a directory separator character.
public static EnsureTerminatingSeparator ( string strPath, bool bUrl ) : string
strPath string Input path.
bUrl bool If true, a slash (/) is appended to /// the string if it's not terminated already. If false, the /// default system directory separator character is used.
Результат string

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

public static FileUrlToPath ( string strUrl ) : string
strUrl string
Результат string

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

public static FilterFileName ( string strName ) : string
strName string
Результат string

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

Get the extension of a file.
public static GetExtension ( string strPath ) : string
strPath string Full path of a file with extension.
Результат string

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

Get the directory (path) of a file name. The returned string may be terminated by a directory separator character. Example: passing C:\\My Documents\\My File.kdb in strFile and true to bAppendTerminatingChar would produce this string: C:\\My Documents\\.
public static GetFileDirectory ( string strFile, bool bAppendTerminatingChar, bool bEnsureValidDirSpec ) : string
strFile string Full path of a file.
bAppendTerminatingChar bool Append a terminating directory separator /// character to the returned path.
bEnsureValidDirSpec bool If true, the returned path /// is guaranteed to be a valid directory path (for example X:\\ instead /// of X:, overriding ). /// This should only be set to true, if the returned path is directly /// passed to some directory API.
Результат string

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

public static GetFileInfos ( DirectoryInfo di, string strPattern, SearchOption opt ) : List
di System.IO.DirectoryInfo
strPattern string
opt SearchOption
Результат List

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

Gets the file name of the specified file (full path). Example: if strPath is C:\\My Documents\\My File.kdb the returned string is My File.kdb.
public static GetFileName ( string strPath ) : string
strPath string Full path of a file.
Результат string

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

public static GetFilePaths ( string strDir, string strPattern, SearchOption opt ) : List
strDir string
strPattern string
opt SearchOption
Результат List

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

Get the host component of an URL. This method is faster and more fault-tolerant than creating an Uri object and querying its Host property.
public static GetHost ( string strUrl ) : string
strUrl string
Результат string

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

Test if a specified path is accessible, either in read or write mode.
public static GetQuotedAppPath ( string strPath ) : string
strPath string
Результат string

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

public static GetShortestAbsolutePath ( string strPath ) : string
strPath string
Результат string

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

public static GetTempPath ( ) : string
Результат string

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

public static GetUrlLength ( string strText, int nOffset ) : int
strText string
nOffset int
Результат int

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

public static HideFile ( string strFile, bool bHide ) : bool
strFile string
bHide bool
Результат bool

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

public static IsAbsolutePath ( string strPath ) : bool
strPath string
Результат bool

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

public static IsUncPath ( string strPath ) : bool
strPath string
Результат bool

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

public static MakeAbsolutePath ( string strBaseFile, string strTargetFile ) : string
strBaseFile string
strTargetFile string
Результат string

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

public static MakeRelativePath ( string strBaseFile, string strTargetFile ) : string
strBaseFile string
strTargetFile string
Результат string

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

public static RemoveScheme ( string strUrl ) : string
strUrl string
Результат string

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

Strip the extension of a file.
public static StripExtension ( string strPath ) : string
strPath string Full path of a file with extension.
Результат string

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

public static UnhideFile ( string strFile ) : bool
strFile string
Результат bool