Arrow گرفتن یک فایل از طریق دیالوگ OpenFileDialog و دستکاری نام فایل
کد PHP:
using System.IO;
OpenFileDialog openFile = new OpenFileDialog();
if (openFile.ShowDialog() != DialogResult.OK)
return;
// get filename from OpenFileDialog
string fileName = openFile.FileName;
// get only filename without extension and path
string onlyname = Path.GetFileNameWithoutExtension(fileName);
// get extension of filename
string extension = Path.GetExtension(fileName);
// get directory of specific filename
string directory = Path.GetDirectoryName(fileName);
// change the extension of specific filename
string newFileName = Path.ChangeExtension(fileName, "bmp");
// get the root partition of specific file
string root = Path.GetPathRoot(fileName);