Gets the absolute path to the specified file. - CSharp System.IO

CSharp examples for System.IO:File Path

Description

Gets the absolute path to the specified file.

Demo Code

//     Permission is hereby granted, free of charge, to any person obtaining a copy of
using System.IO;//from  w  w w .  j a v a  2 s.c  o m

public class Main{
        /// <summary>
        /// Gets the absolute path to the specified file.
        /// </summary>
        /// <param name="path">(Relative) path to resolve.</param>
        /// <returns>The absolute path to the specified relative path on the file system.</returns>
        public static string GetAbsolutePath(string path)
        {
            return Path.Combine(Directory.GetCurrentDirectory(), path);
        }
}

Related Tutorials