Если я перетаскиваю файл, который может быть аудио, видео, exe и т. Д. c и т. c ... в TextBox Control
Как мне получить полный путь к файлу просто загляните в textBox, пожалуйста ...
пока у меня есть
private void Form1_Load(object sender, EventArgs e)
{
textBox1.AllowDrop = true;
}
private void textBox1_DragDrop(object sender, DragEventArgs e)
{
string[] s = (string[]) e.Data.GetData(DataFormats.FileDrop, false);
}
private void textBox1_DragEnter(object sender, DragEventArgs e)
{
// Check if the Dataformat of the data can be accepted
// (we only accept file drops from Explorer, etc.)
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.Copy; // Okay
else
e.Effect = DragDropEffects.None; // Unknown data, ignore it
}
Спасибо