Expand|Select|Wrap|Line Numbers
- Could not find file 'C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\Default4.txt'.
- Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
- Exception Details: System.IO.FileNotFoundException: Could not find file 'C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\Default4.txt'.
- Source Error:
- Line 17: protected void Page_Load(object sender, EventArgs e)
- Line 18: {
- Line 19: StreamReader cr = new StreamReader("Default4.txt");
- Line 20: string contents = null;
- Line 21: contents = cr.ReadToEnd();
- Source File: c:\Documents and Settings\Main\My Documents\Visual Studio 2005\WebSites\WebSite2\Default4.aspx.cs Line: 19
- Stack Trace:
- [FileNotFoundException: Could not find file 'C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\Default4.txt'.]
- System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +1971213
- System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +998
- System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) +115
- System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) +85
- System.IO.StreamReader..ctor(String path) +112
- _Default.Page_Load(Object sender, EventArgs e) in c:\Documents and Settings\Main\My Documents\Visual Studio 2005\WebSites\WebSite2\Default4.aspx.cs:19
- System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +13
- System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +45
- System.Web.UI.Control.OnLoad(EventArgs e) +80
- System.Web.UI.Control.LoadRecursive() +49
- System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3745
- Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
Expand|Select|Wrap|Line Numbers
- using System;
- using System.Data;
- using System.Configuration;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using System.IO;
- /// <summary>
- /// Summary description for Default4
- /// </summary>
- public partial class _Default : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- StreamReader cr = new StreamReader("Default4.txt");
- string contents = null;
- contents = cr.ReadToEnd();
- Label1.Text = contents;
- cr.Close();
- //Label1.Text = "<p align=center>Hello World</p>";
- }
- }
Expand|Select|Wrap|Line Numbers
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="~/Default4.aspx.cs" Inherits="_Default"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <script runat="server">
- </script>
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head runat="server">
- <style type="text/css">
- .staticMenuItem
- {
- color:White;
- font-weight: bold;
- text-align: center;
- /*border:solid 1px black;
- padding:2px 4px;*/
- }
- .menuHover
- {
- color:#ffcc00;
- background-color:#ff3300;
- }
- .dmenuHover
- {
- color:blue;
- background-color:#ff9900;
- }
- .dynamicMenuItem
- {
- color:white;
- font-weight: bold;
- text-align: center;
- /*background-color:#FF6600;*/
- padding:2px 4px;
- }
- .dynamicMenu
- {
- /*the background color for the dynamic menus both "popout" and non is covered by the
- DynamicMenuStyle-BackColor="#FF6600" in the <asp:Menu> tag*/
- /*background-color: #ffcc00;*/
- /*background-color: green;*/
- /*font-weight: bold;
- text-align: center;*/
- /*border:Solid 1px black;
- filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=5, OffY=5, Color='gray', Positive='true')" ;*/
- }
- </style>
- <title>Untitled Page</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
-
- <asp:Menu ID="Menu1" runat="server" BackColor="#990000" DynamicMenuStyle-BackColor="#333333" DataSourceID="SiteMapDataSource1" StaticDisplayLevels="2"
- StaticMenuItemStyle-CssClass="staticMenuItem"
- StaticHoverStyle-CssClass="menuHover"
- DynamicHoverStyle-CssClass="menuHover"
- DynamicMenuItemStyle-CssClass="dynamicMenuItem"
- DynamicMenuStyle-CssClass="dynamicMenu">
- <StaticMenuItemStyle ItemSpacing="20px" />
- <DynamicMenuItemStyle ItemSpacing="0px" />
- </asp:Menu>
- <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
- <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
- </div>
- </form>
- </body>
- </html>
Expand|Select|Wrap|Line Numbers
- <br /><p align=right>Hello There World!!</p>
Expand|Select|Wrap|Line Numbers
- C:\\Documents and Settings\\Main\\My Documents\\Visual Studio 2005\\WebSites\\WebSite2\\