mail-archives/gtk-sharp-list/2004-November/005159.html

97 строки
3.1 KiB
HTML
Исходник Обычный вид История

2019-06-06 22:02:55 +03:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Drag and drop path
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:Mike%20Rhodes%20%3Cmike.rhodes%40gmail.com%3E">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="005157.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Drag and drop path
</H1>
<B>Mike Rhodes
</B>
<A HREF="mailto:Mike%20Rhodes%20%3Cmike.rhodes%40gmail.com%3E"
TITLE="[Gtk-sharp-list] Drag and drop path">Mike Rhodes &lt;mike.rhodes@gmail.com&gt;
</A><BR>
<I>Mon, 29 Nov 2004 22:01:45 +0000</I>
<P><UL>
<LI> Previous message: <A HREF="005157.html">[Gtk-sharp-list] Drag and drop path
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#5159">[ date ]</a>
<a href="thread.html#5159">[ thread ]</a>
<a href="subject.html#5159">[ subject ]</a>
<a href="author.html#5159">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>I use this code:
[DllImport (&quot;libgnomevfs-2.dll&quot;)]
private static extern IntPtr gnome_vfs_get_local_path_from_uri (string str);
public static string LocalPathFromUri (string uri)
{
IntPtr p = gnome_vfs_get_local_path_from_uri (uri);
if (p == IntPtr.Zero)
return null;
else
return GLib.Marshaller.PtrToStringGFree (p);
}
(All credit goes to the Muine code where I found it =) ) I believe
gnome-vfs isn't part of gtk-sharp as of yet, so I'm not sure of
another way to do it.
Mike.
p.s. btw, if you are thinking of writing a C# music player, I'm also
writing one; perhaps we could team up -- or at least solve some of the
issues that come up -- drop me a line off-list if you are interested!
On Mon, 29 Nov 2004 19:08:26 +0100, Christian Rudh
&lt;<A HREF="mailto:lists-christian@rudh.se">lists-christian@rudh.se</A>&gt; wrote:
&gt;<i> Hi
</I>&gt;<i>
</I>&gt;<i> When drop a file on my application i get the URL in the following
</I>&gt;<i> format:
</I>&gt;<i>
</I>&gt;<i> <A HREF="file:///home/user/song%20X.mp3">file:///home/user/song%20X.mp3</A>
</I>&gt;<i>
</I>&gt;<i> To be able to pass it on to Gst# (for example) I have to remove the
</I>&gt;<i> file:// part and replace %20 with spaces (that goes for other special
</I>&gt;<i> characters to). Is there any simple way to decode the string to a normal
</I>&gt;<i> Unix path? Like the System.Web.HttpUtility.HTMLDecode that MS .NET has?
</I>
--
&quot;One should not aim at being possible to
understand but at being impossible to
misunderstand.&quot; - Quintilian
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="005157.html">[Gtk-sharp-list] Drag and drop path
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#5159">[ date ]</a>
<a href="thread.html#5159">[ thread ]</a>
<a href="subject.html#5159">[ subject ]</a>
<a href="author.html#5159">[ author ]</a>
</LI>
</UL>
</body></html>