I use Visual Studio 2008, .net framework 3.5
I have an webservice application (a winform client which is using webservice), and I have to run it in Administrator account
I need to drag and drop files from windows explorer to a form of this application.
Here is my code:
this.AllowDrop = true;
private void Form1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop, false))
e.Effect = DragDropEffects.All;
}
private void Form1_DragDrop(object sender, DragEventArgs e)
{
string[] fileList = e.Data.GetData(DataFormats.FileDrop) as string[];
foreach (string s in fileList)
{
MessageBox.Show(s);
}
}
It works when I run in normal account, but in Administrator It doesn't. How to solve it?