Hello,
I am trying to display items from a search location the user has pick.
And I am not quite sure on how one would store and then display the
browsed area?
I hope you understand what I am trying to do.
Thanks for your help!
Loading
Mike GoldPosted Oct 17, 2007, 12:13 AM
Ahh...Now its much more clear what you are trying to do.
Use
string mySong = System.IO.Path.GetFileName(mp3).
If you want to drop the extension, use
string mySong = System.IO.GetFileNameWithoutExtension(mp3);
Best,
MichaelPosted Oct 16, 2007, 1:23 PM
foreach (string mp3 in Directory.GetFiles(musicPath.Text))
this.listBox1.Items.Add(mp3);
to get the list of what was in a folder.
But now I would like to make it so only the names of the files that are in said folder to show up. Not that whole path just the name. Is that possible?
Mike GoldPosted Oct 16, 2007, 1:10 PM
you probably want to scrape the info directly from the web request:
Here is the code to get data into a string from a url request
//Create a HttpWebRequest object for the server search URL
HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create(String.Format("{0}{1}&d=e", ServerURL, stock));
// retrieve the response web page we want to scrape and put it into a string
HttpWebResponse webresp = (HttpWebResponse)webreq.GetResponse();
StreamReader strm = new StreamReader(webresp.GetResponseStream(), Encoding.ASCII);
string res = strm.ReadToEnd();
Afterword, if you want to display it as html, use the WebBrowser Control, otherwise you can use either a rich text box or a multiline textbox