Finds the path to a file or a directory.

Namespace:  SGP.XUtility
Assembly:  SGP.XUtility (in SGP.XUtility.dll)
Version: 1.2.3019.18718

Syntax

C#
public static string FindPath(
	string fileName
)

Parameters

fileName
Type: System..::.String
The file name or the directory name with the relative path.

Return Value

The absolute path to the found file or directory including.

Remarks

In fileName are at first evaluated variables (Expand(String, IXVarDictionary, String, String)) and environment variables (ExpandEnvironmentVariables(String)). Than the method is trying to find the directory or file at first in the current directory and and than in the running application folder StartupPath. If it is found (a file or a directory exists), returns its absolute path. Otherwise returns only fileName with evaluated variables as a absolute path.
Note: If is in XServiceManager a service IXSGPToolProjectFolderService and ProjectFolder is not nullNothingnullptra null reference (Nothing in Visual Basic), ProjectFolder is used instead of running application folder.

Exceptions

ExceptionCondition
System..::.ArgumentNullException fileName is nullNothingnullptra null reference (Nothing in Visual Basic).

See Also