popopop
February 24th, 2010, 02:57 AM
Hi all
I'm working with special characters in filename
my project is a Drag n Drop app, just drop a illegal filename and covert it legal
it's worked fine on windows but not on ubuntu
[solution 1]
using winform and System.Windows.Forms.DragEventArgs
with this line to receive file drop
string[] photo = (string[])e.Data.GetData(DataFormats.FileDrop, false);
sample, if filename is " $@#%^&.jpg "
on windows it return photo[0] = " $@#%^&.jpg " it's right
but in the same code on ubuntu, it return photo[0] = " /@ %$#.jpg " ??
ubuntu gives the wrong filename, why..ubuntu? nautilus?
so..
[solution 2]
using Gtk# and Gtk.DragDataReceivedArgs
with this line to receive file drop
string data = System.Text.Encoding.UTF8.GetString(args.Selection Data.Data);
gtk return a uri but system.io.file class doesn't suppprt uri, so i can't copy it with file.copy method
is there another solution? :confused:
Thank you so much
and sorry for my english
Giggs, popopop
I'm working with special characters in filename
my project is a Drag n Drop app, just drop a illegal filename and covert it legal
it's worked fine on windows but not on ubuntu
[solution 1]
using winform and System.Windows.Forms.DragEventArgs
with this line to receive file drop
string[] photo = (string[])e.Data.GetData(DataFormats.FileDrop, false);
sample, if filename is " $@#%^&.jpg "
on windows it return photo[0] = " $@#%^&.jpg " it's right
but in the same code on ubuntu, it return photo[0] = " /@ %$#.jpg " ??
ubuntu gives the wrong filename, why..ubuntu? nautilus?
so..
[solution 2]
using Gtk# and Gtk.DragDataReceivedArgs
with this line to receive file drop
string data = System.Text.Encoding.UTF8.GetString(args.Selection Data.Data);
gtk return a uri but system.io.file class doesn't suppprt uri, so i can't copy it with file.copy method
is there another solution? :confused:
Thank you so much
and sorry for my english
Giggs, popopop