VB6 -> GetAbsolutePathName equivalent method in c#?

  • Thread starter Thread starter ricolee99
  • Start date Start date
R

ricolee99

Hi There,

I'm trying to convert some VB code into C#.

There is a function defined in VB, GetAbsolutePathName(path) where it
returns the complete path from the root of the drive for the specified
path.


so for ex.: Assume that the current directory is c:\temp\test:

------------------------------------------------------------
<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("c:")
response.write(path)
%>Output:

c:\temp\testExample 2

<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("mydoc.txt")
response.write(path)
%>Output:

c:\temp\test\mydoc.txtExample 3

<%
dim fs,path
set fs=Server.CreateObject("Scripting.FileSystemObject")
path=fs.GetAbsolutePathName("private\mydoc.txt")
response.write(path)
%>Output:

c:\temp\test\private\mydoc.txt
------------------------------------------------------------

is there an equivalent method in c#?

Thanks!

Sharon
 
Back
Top