Dear sir ,
I use as String[] urls = File.ReadAllLines(@"http://xxx.xxx.x.xx/urls.txt"); but its shows an error as "URI formats are not supported." so how can I access text file from our server/localhost.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Nitin SontakkeRank #264 · 9.6K reputationPosted Sep 23, 2016, 2:02 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Sep 23, 2016, 1:12 AM EDT
Delpin Susai RajRank #53 · 29.5K reputationPosted Sep 22, 2016, 11:46 PM EDT
Delpin Susai RajRank #53 · 29.5K reputationPosted Sep 22, 2016, 11:47 PM EDT
Delpin Susai RajRank #53 · 29.5K reputationPosted Sep 22, 2016, 11:48 PM EDT
private void Error(string error) { var dir= new DirectoryInfo(@"yourpathhere"); var fi = new FileInfo(Path.Combine(dir.FullName, "errors.txt")); using (FileStream fs = fi.OpenWrite()) { StreamWriter sw = new StreamWriter(fs); sw.Write(error); sw.Close(); sw.Dispose(); } }Delpin Susai RajRank #53 · 29.5K reputationPosted Sep 22, 2016, 11:48 PM EDT
private void PopulateGrid() { try { DirectoryPath = @"\\[WEBSERVER]\[filesVirtualDirectory]\" + Convert.ToString(Request.QueryString["ID"]); DirectoryInfo currentDirInfo = new DirectoryInfo(DirectoryPath); // pass a class object as datasource to gridView object fsItems = new List<FilesInfo>(); if (currentDirInfo.Exists) { foreach (FileInfo fi in currentDirInfo.GetFiles()) { FilesInfo fInfo = new FilesInfo(); fInfo.Name = fi.Name; fInfo.Extension = fi.Extension; fInfo.FileLink = "//[WEBSERVER]/[filesVirtualDirectory]/" + Convert.ToString(Request.QueryString["ID"]) + "/" + fi.Name; fsItems.Add(fInfo); } } gvFiles.DataSource = fsItems; gvFiles.DataBind(); } catch (Exception ex) { ExceptionLogger.LogError(ex); } }pre>adam gills65 reputationPosted Sep 23, 2016, 12:15 AM EDT
adam gills65 reputationPosted Sep 23, 2016, 12:40 AM EDT
adam gills65 reputationPosted Sep 23, 2016, 1:35 AM EDT
adam gills65 reputationPosted Sep 23, 2016, 4:05 AM EDT
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Sep 23, 2016, 4:16 AM EDT