Results 1 to 15 of 15

Thread: [RESOLVED] change Directory path

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2015
    Posts
    102

    Resolved [RESOLVED] change Directory path

    i can change Directory this code
    the Directory path from C:\Users\user\Music
    i want change it to URL : >> http://sitename/music

    here the code
    Code:
    Public Class RingTones
    
    
        Public musicNames(1000) As String
        Private Sub RingTones_Load(ByVal Sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim arraycount As Integer = 0
            My.Computer.FileSystem.CurrentDirectory =
        My.Computer.FileSystem.SpecialDirectories.MyMusic
            For Each File As String In
        My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.CurrentDirectory, FileIO.SearchOption.SearchAllSubDirectories, "*.mp3")
                ListBox1.Items.Add(My.Computer.FileSystem.GetFileInfo((File)).Name)
                musicNames(arraycount) = My.Computer.FileSystem.GetFileInfo((File)).FullName
                arraycount = arraycount + 1
            Next
        End Sub

  2. #2
    Frenzied Member Bulldog's Avatar
    Join Date
    Jun 2005
    Location
    South UK
    Posts
    1,950

    Re: change Directory path

    From FileInfo you have the file name, prepend the URL to that string, or am I missing something?


    • If my post helped you, please Rate it
    • If your problem is solved please also mark the thread resolved

    I use VS2015 (unless otherwise stated).
    _________________________________________________________________________________
    B.Sc(Hons), AUS.P, C.Eng, MIET, MIEEE, MBCS / MCSE+Sec, MCSA+Sec, MCP, A+, Net+, Sec+, MCIWD, CIWP, CIWA
    I wrote my very first program in 1979, using machine code on a mechanical Olivetti teletype connected to an 8-bit, 78 instruction, 1MHz, Motorola 6800 multi-user system with 2k of memory. Using Windows, I dont think my situation has improved.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2015
    Posts
    102

    Re: change Directory path

    still am looking for help
    anyone ?

  4. #4
    Lively Member ShadowTzu's Avatar
    Join Date
    Oct 2014
    Location
    France
    Posts
    68

    Re: change Directory path

    This code cannot work with a url. if you give us more detail about your url may be we can help you to extract the list.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2015
    Posts
    102

    Re: change Directory path

    i want this path music for list box
    Code:
    http://kankon.us/music
    Last edited by kankon; Feb 26th, 2015 at 08:00 AM. Reason: wrong url

  6. #6
    Lively Member ShadowTzu's Avatar
    Join Date
    Oct 2014
    Location
    France
    Posts
    68

    Re: change Directory path

    ok, I can't see any list of files because I am not registered. Which mean that is not easy to grab it by code.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2015
    Posts
    102

    Re: change Directory path

    but u can listen from line try, u don't need register
    Code:
    http://kankon.us/music/Diamonds_mobile.mp3

  8. #8
    Lively Member ShadowTzu's Avatar
    Join Date
    Oct 2014
    Location
    France
    Posts
    68

    Re: change Directory path

    what you want is not grab only one file, but a list a files, without being registered we can't get this list.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Feb 2015
    Posts
    102

    Re: change Directory path

    ohh i see
    so i need create shared folders server
    how about make it with "OneDrive" its work or i need "dropbox" ?

  10. #10
    Lively Member ShadowTzu's Avatar
    Join Date
    Oct 2014
    Location
    France
    Posts
    68

    Re: change Directory path

    I don't know, I never try

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Feb 2015
    Posts
    102

    Re: change Directory path


  12. #12

    Thread Starter
    Lively Member
    Join Date
    Feb 2015
    Posts
    102

    Re: change Directory path

    hum i just test its work now after change

    Old

    Code:
    Public Class RingTones
    
    
        Public musicNames(1000) As String
        Private Sub RingTones_Load(ByVal Sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim arraycount As Integer = 0
            My.Computer.FileSystem.CurrentDirectory =
        My.Computer.FileSystem.SpecialDirectories.MyMusic
            For Each File As String In
        My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.CurrentDirectory, FileIO.SearchOption.SearchAllSubDirectories, "*.mp3")
                ListBox1.Items.Add(My.Computer.FileSystem.GetFileInfo((File)).Name)
                musicNames(arraycount) = My.Computer.FileSystem.GetFileInfo((File)).FullName
                arraycount = arraycount + 1
            Next
        End Sub
    New
    Code:
     Private Sub Form1_Load(ByVal Sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          
            
    
            Dim arraycount As Integer = 0
            My.Computer.FileSystem.CurrentDirectory =
        My.Computer.FileSystem.SpecialDirectories.MyMusic
            For Each File As String In
        My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.CurrentDirectory, FileIO.SearchOption.SearchAllSubDirectories, "*.mp3")
                ListBox1.Items.Add("Https://onedrive.live.com/?cid=899689126101ff78&id=899689126101FF78%218281&ithint=folder,mp3&authkey=!ACX1YUwHh3kOfqA")
                musicNames(arraycount) = My.Computer.FileSystem.GetFileInfo(((File))).FullName
                arraycount = arraycount + 1
              
            Next
    
        End Sub

    but the problem now its add full link in list lol
    i can add only the name song ?
    Attached Images Attached Images  
    Last edited by kankon; Feb 26th, 2015 at 08:50 AM.

  13. #13
    Lively Member ShadowTzu's Avatar
    Join Date
    Oct 2014
    Location
    France
    Posts
    68

    Re: change Directory path

    yeah, it's not a solution because you have the same link for every line.
    I have found this:
    http://www.codeguru.com/columns/dotn...from-code.html
    with a access_token you can grab the list.

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Feb 2015
    Posts
    102

    Re: change Directory path

    awesome , thank you very much ShadowTzu ,

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Feb 2015
    Posts
    102

    Re: [RESOLVED] change Directory path

    found something wrong i need help again

    so the correct director path
    the red line

    Code:
       Public musicNames(1000) As String
        Private Sub RingTones_Load(ByVal Sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim arraycount As Integer = 0
            My.Computer.FileSystem.CurrentDirectory = My.Computer.FileSystem.SpecialDirectories.MyMusic
            For Each File As String In
        My.Computer.FileSystem.GetFiles(My.Computer.FileSystem.CurrentDirectory, FileIO.SearchOption.SearchAllSubDirectories, "*.mp3")
                ListBox1.Items.Add(My.Computer.FileSystem.GetFileInfo((File)).Name)
                musicNames(arraycount) = My.Computer.FileSystem.GetFileInfo((File)).FullName
                arraycount = arraycount + 1
            Next
    that's mean from my pc my music folder
    i want change it url this one (( https://onedrive.live.com/?cid=89968...CX1YUwHh3kOfqA ))
    , anyone would help me

    thank you

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