Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to get the absolute path of a known file name in asp.net website

$
0
0

Hi,

<linkhref="Styles/StyleSheet2.css"rel="stylesheet"type="text/css"/>

Above is a line that I extracted from a webpage. I want to get all the css file contents of those which are attached to the web page. from the below line, i can get the 

Styles/StyleSheet2.css

part. it say's I have the Styles2.css in the Styles folder. to read the css file content, I want to get the absolute path of the file StyleSheet2.css. I tried  this,

string fileContent =System.IO.File.ReadAllText(Path.GetFullPath(file));

where i refer file as Styles/StyleSheet.css but I'm not getting the correct output. someone please give a help

thanks in adnvance


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>