Skip to main content
added 118 characters in body
Source Link
Demodave
  • 6.7k
  • 7
  • 47
  • 63
 string fileAndPath = @"c:\webserver\public\myCompany\configs\promo.xml"; string currentDirectory = Path.GetDirectoryName(fileAndPath); string fullPathOnly = Path.GetFullPath(currentDirectory); 

currentDirectory: c:\webserver\public\myCompany\configs

fullPathOnly: c:\webserver\public\myCompany\configs

 string fileAndPath = @"c:\webserver\public\myCompany\configs\promo.xml"; string currentDirectory = Path.GetDirectoryName(fileAndPath); string fullPathOnly = Path.GetFullPath(currentDirectory); 
 string fileAndPath = @"c:\webserver\public\myCompany\configs\promo.xml"; string currentDirectory = Path.GetDirectoryName(fileAndPath); string fullPathOnly = Path.GetFullPath(currentDirectory); 

currentDirectory: c:\webserver\public\myCompany\configs

fullPathOnly: c:\webserver\public\myCompany\configs

added 36 characters in body
Source Link

string fileNameWithPath = @"c:\webserver\public\myCompany\configs\promo.xml";

string currentDirectory = Path.GetDirectoryName(fileNameWithPath);

string fullPathOnly = Path.GetFullPath(currentDirectory);

 string fileAndPath = @"c:\webserver\public\myCompany\configs\promo.xml"; string currentDirectory = Path.GetDirectoryName(fileAndPath); string fullPathOnly = Path.GetFullPath(currentDirectory); 

string fileNameWithPath = @"c:\webserver\public\myCompany\configs\promo.xml";

string currentDirectory = Path.GetDirectoryName(fileNameWithPath);

string fullPathOnly = Path.GetFullPath(currentDirectory);

 string fileAndPath = @"c:\webserver\public\myCompany\configs\promo.xml"; string currentDirectory = Path.GetDirectoryName(fileAndPath); string fullPathOnly = Path.GetFullPath(currentDirectory); 
Source Link

string fileNameWithPath = @"c:\webserver\public\myCompany\configs\promo.xml";

string currentDirectory = Path.GetDirectoryName(fileNameWithPath);

string fullPathOnly = Path.GetFullPath(currentDirectory);