c# - accesssing File within directory and subdirectory giving me error -- URI formats are not supported -


I am trying to get files and subdirectories in the directory from a webpage. I do not know that this is the right idea I am using. If not, please give me an idea of ​​how to use files and folders on the AIPA address server

The code below is not supported "URI format." Error.

I want to use the local directory as I have to use the file from that address (Apache server)

  public static DataTable search_method (string searchkeyword ) {String path = "http://192.168.2.10/mywebsite/"; Datatyal table = new datatile (); Table.Columns.Add ("AnchorText"); Table.Columns.Add ("DT"); Detrovert dr = null; Foreach (string file (path, Directory, SearchOption.AllDirectories) in Directory.GetFiles "* *.") {If (file.Contains (searchkeyword)) {string AnchorText = Path.GetFileNameWithoutExtension (file); Datetime DT = File Getlastrite (path); Dr = table Navre (); Dr. [1] = Anchartext; Dr. [2] = DT; Table.Rows.Add (DR); }} Return table; }  itemprop = "text"> 

error tells you what's wrong, and if you can not do it then

If you look at it, you see that the first parameter is path , which is the directory to search directory on a path on your server URI is not, therefore, URI formats are not supported . You can use this to search the directory on your server, rather than any other web server that you use only through the URL.

You can create a Web server by requesting it, but it will be similar to viewing one page in a browser, do not like to search the directory in GetFiles is.

You will not be able to see the list of those files in the directory on the webserver, unless they allow them. If they are, then try.


Comments