Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi
i need to display list of files from remote server which has the keyword i specify in a textbox. and also need to see that file when double cliked on it.
which control should i use to display the list...if i use listbox, i think there is no double click event.
i tried the below code :-

C#
string filename = TextBox1.Text;
        if (File.Exists(Server.MapPath("files/" + (filename))))       
        {
            Response.Write("file exist");
            ListBox1.Items.Add(filename);
            
        }
        else
        { 
            Response.Write("no");
        }


here file is the folder name,
the above shows only single file, and it is displayed only when the complete name is inputed.


can any one help me...
thanks in advance...
Posted
Updated 6-Dec-11 23:47pm
v3

1 solution

Use the fileinfo and directory info class to get the list of all files and add them to an collection class like arraylist. Search the collection class and the obtain the file name from the collection class then use it with the above code.
 
Share this answer
 
Comments
Ragi Gopi 7-Dec-11 5:53am    
can u plz provide me an example

plzzz help me.......

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900