I have a cursor file in project. I have given the absolute path in code i.e
F:/r.cur
the problem is this is hard-coded path And i Want
You can also get by
System.IO.Directory.GetCurrentDirectory();
but it shows bin and debug folder also, if you don't want these folder so you can use that code :
string page = "E:\abccom\Cat\Mouse.aspx"
string name = Path.GetFileName(page );
string nameKey = Path.GetFileNameWithoutExtension(page );
string directory = Path.GetDirectoryName(page );
Console.WriteLine("{0}, {1}, {2}, {3}",
page, name, nameKey, directory);
Output:
GetFileName: Mouse.aspx
GetFileNameWithoutExtension: Mouse
GetDirectoryName: E:\abccom\Cat
Happy Coding :)