Dug Posted May 17, 2009 Posted May 17, 2009 Hi there, I'm just about banging my head on the table with this one, so I hope someone can help. I'm making a Facebook application - I have a windows application that uploads a text file to my web server, and I want to compare the name of the text file to the first name and last name of the Facebook user, and if they are the same, then open the text file. When I was playing around with it, I printed the path and file name, but it looked like there was a space before the file name and before the file extension. My original idea behind it was: Dim Name As String = _fbService.fql.query("SELECT first_name, last_name FROM user WHERE uid = '" & Session("Facebook_userId") & "'") Dim File As String Dim s as String For Each s in Directory.GetFiles(Server.MapPath("/NowPlaying/"), "*.txt") File = GetFileNameWithoutExtension(s) If File = Name Then Response.Write(File) End If Next It seems like it should be very simple, but nothing works!! Hope someone will be able to help. Thanks Dug Quote
Administrators PlausiblyDamp Posted May 18, 2009 Administrators Posted May 18, 2009 You could use the .Trim() method on the filename and extension to remove any leading / trailing spaces/ Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.