Files to clipboard

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Someone knows how to copy Files into the clipboard using C#? I've tried
filling a DataFormat with FileDrop and I passed a string with the filename to
setData() but no luck. I've also tried with a FileInfo object but It does not
work. Is it possible? Please help!!!
 
You can't. Assuming you are using a webpage, browsers aren't allowed to
touch system resources. Your best bet is to write or use an activeX control
with the appropriate permissions.

--
Regards,
Alvin Bruney

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
 
I'm NOT in a browser. Actually I'm writing a standard Window Form
application, so I suppose I have the rights to do it. By the way, it's not a
professional app, so security is not an issue. I really need how to do it in
C#, I know that is possible using Win32 API and filling a DROPFILES struct,
I hope I can also in C#!!
Regards

Alvin Bruney said:
You can't. Assuming you are using a webpage, browsers aren't allowed to
touch system resources. Your best bet is to write or use an activeX control
with the appropriate permissions.

--
Regards,
Alvin Bruney

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
----------------------------------------------------------


sithlord said:
Someone knows how to copy Files into the clipboard using C#? I've tried
filling a DataFormat with FileDrop and I passed a string with the filename
to
setData() but no luck. I've also tried with a FileInfo object but It does
not
work. Is it possible? Please help!!!
 
Try DoDragDrop(new DataObject(DataFormats.FileDrop, path));

Don't know if it works, I just suppose this should be the right way...

HTH,
Stefan

sithlord said:
I'm NOT in a browser. Actually I'm writing a standard Window Form
application, so I suppose I have the rights to do it. By the way, it's
not a
professional app, so security is not an issue. I really need how to do it
in
C#, I know that is possible using Win32 API and filling a DROPFILES
struct,
I hope I can also in C#!!
Regards

Alvin Bruney said:
You can't. Assuming you are using a webpage, browsers aren't allowed to
touch system resources. Your best bet is to write or use an activeX
control
with the appropriate permissions.

--
Regards,
Alvin Bruney

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
----------------------------------------------------------


sithlord said:
Someone knows how to copy Files into the clipboard using C#? I've tried
filling a DataFormat with FileDrop and I passed a string with the
filename
to
setData() but no luck. I've also tried with a FileInfo object but It
does
not
work. Is it possible? Please help!!!
 
Back
Top