Results 1 to 11 of 11

Thread: [RESOLVED] [3.0/linq]

  1. #1

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Resolved [RESOLVED] [3.0/linq]

    Hi,

    im trying to build a uri and heres what i have :

    C# Code:
    1. Uri Path= new Uri(PathString) ;
    2.  
    3. Player.Source=Path;
    4.  
    5. ''Just to check what did the uri come up with
    6. Label1.content= Player.Source.Tostring() ;

    the path string is equal to :

    D:\Documents and Settings\Prox-Yd\Mis documentos\Mi música\Pablo\carlos santana & everlast - supernatural - turn your lights on.mp3

    and what the uri came up with its :

    file:///D:\Documents and Settings\Prox-Yd\Mis documentos\Mi música\Pablo\carlos santana & everlast - supernatural - turn your lights on.mp3

    So Player cant find the path of what the uri came up with so i cant use that, how can i remove the file:/// ?

    thanks
    C# and WPF developer
    My Website:
    http://singlebits.com/

  2. #2
    Fanatic Member
    Join Date
    Jun 2003
    Location
    Worcester, MA
    Posts
    782

    Re: [3.0/linq]

    Have you tried using Path.LocalPath?
    C#.net, VB, C++, Java, VS 2005/2008
    Dont' forget to rate posts that are helpful to you.

  3. #3

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: [3.0/linq]

    Path its a variable in my appliacation

    Path.LocalPath, im not using any of those beacuse, what i need to come up with its a uri containg the path of the file droped by the user, but ive already done that, the problem is if i use Path.LocalPath ill come up with a string and when i turn that into a uri it comes out with the file:/// before, so i dont know how to remove the f:///
    Last edited by Pac_741; Jun 30th, 2008 at 08:58 AM.
    C# and WPF developer
    My Website:
    http://singlebits.com/

  4. #4
    Fanatic Member
    Join Date
    Jun 2003
    Location
    Worcester, MA
    Posts
    782

    Re: [3.0/linq]

    What kind of object is Player? Can it only take a Uri as the parameter for the path?
    C#.net, VB, C++, Java, VS 2005/2008
    Dont' forget to rate posts that are helpful to you.

  5. #5

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: [3.0/linq]

    Im using MediaElement a WPF control, and yes it can only take Uri as path
    C# and WPF developer
    My Website:
    http://singlebits.com/

  6. #6

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: [3.0/linq]

    I was trying to create some Uris in other applications and all of them turned out like this one, Steve_F do you have the same problem ? or does anyone else has the same problem ?? i didnt have this problem before i installed 3.5 service pack 1 and i dont know if that caused the problem
    C# and WPF developer
    My Website:
    http://singlebits.com/

  7. #7
    Fanatic Member
    Join Date
    Jun 2003
    Location
    Worcester, MA
    Posts
    782

    Re: [3.0/linq]

    Yeah I tried to create some and they all have the file://. It dind't have the prefix when I tried using a URL as a parameter. So the method must take the format of the passed string into consideration. Im just not sure how to let it know youre using a directory as a parameter...
    C#.net, VB, C++, Java, VS 2005/2008
    Dont' forget to rate posts that are helpful to you.

  8. #8
    Fanatic Member
    Join Date
    Jun 2003
    Location
    Worcester, MA
    Posts
    782

    Re: [3.0/linq]

    The constructor for a Uri is overloaded, the solution might be something with that, im trying now.
    C#.net, VB, C++, Java, VS 2005/2008
    Dont' forget to rate posts that are helpful to you.

  9. #9

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: [3.0/linq]

    i got it, for some reason .net 3.5 service pack 1 was causing the problem thats what i think, i uninstalled it the problem was gone
    C# and WPF developer
    My Website:
    http://singlebits.com/

  10. #10

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: [3.0/linq]

    when i create uris for other objects it doenst contain the f:/// but when i use them for the media element the uri turns out wiht a f:///
    C# and WPF developer
    My Website:
    http://singlebits.com/

  11. #11

    Thread Starter
    Hyperactive Member Pac_741's Avatar
    Join Date
    Jun 2007
    Location
    Mexico
    Posts
    298

    Re: [3.0/linq]

    Steve_F, thank you very much for your time

    the problem wasnt .Net 3.5 service pack 1, nor the uris the problem was i was using windows xp without windows media player 10 or greater, so the media control just works with media player 10 or greater so that was the problem
    C# and WPF developer
    My Website:
    http://singlebits.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width