Does anyone have a file checking method in c# or should I use a try statmentIf you simply want to see whether or not it exists before writing to it, you could use OpenOrCreate mode, like so:<BR><BR> FileStream fs = new FileStream("foo.txt", FileMode.OpenOrCreate)<BR><BR>Or, you could simply use the static Exists method of the System.IO.File class, like so...<BR><BR>if( System.IO.File.Exists( strPath ) )<BR>{<BR> ....do stuff<BR>}<BR><BR>Thanks just what I needed am using it in iewc treenav for an intranet see below<BR><BR> <script runat=server id="treeScript" ><BR> string navStr;<BR> string Str;<BR> <BR> void Page_Load(object sender, System.EventArgs e){<BR>navStr = "http://localhost:9003/XMLnav/treeXML/";<BR>Str = Request.QueryString.Get("nav");<BR>navStr = navStr + Str;<BR> <BR>if( System.IO.File.Exists(navStr) )<BR>{<BR>TreeView1.TreeNodeSrc = http://aspmessageboard.com/archive/index.php/navStr;<BR>TreeView1.TreeNodeTypeSrc="http://localhost:9003/XMLnav/treeXML/TreeNodeTypes.xml";<BR>TreeView1.DataBind();<BR>}<BR>else{<BR>Message.Text = "Your xml file has not been found" + DateTime.Now;<BR><BR>}<BR><BR>}<BR></script>