That's because that isn't code that anyone should ever use!

try:


File.WriteallText("c:\testfile.txt", "Hello World")

On Tue, Feb 15, 2011 at 11:52 PM, Davej <[email protected]> wrote:

> Well, all of my past VB.NET programming has involved "drag and drop"
> toolbox functions, not console style code such as;
>
> Dim fso, fs As Objects
> Set fso = CreateObject("Scripting.FileSystemObject")
>
> Set fs = fso.OpenTextFile("c:\testfile.txt", 2, True)
>
> fs.WriteLine "Hello world!"
> fs.Close
>
> And the Visual Studio doesn't seem to offer any Intellisense help for
> writing this code either.
>
> On Feb 11, 10:20 pm, DanH <[email protected]> wrote:
> > You cannot run a console app from ASP.NET. I'm not sure what your
> > thinking is on this, but ASP.NET does web pages. Code behind is server
> > side code that is executed when something like a button placed in
> > the .aspx page is clicked from the client browser. Below is an example
> > of using code behind (I'm using c#, but it's the same principle), a
> > textbox and a button are placed in the page, click the button and a
> > post back to the sever executes the Button1_Click event and sent back
> > to the client with "Hello World" in TextBox1. You can work with it in
> > a similar way as a Windows Form application.
> > I hope this helps
> >
> > ASPX page:
> > <%@ Page Language="C#" AutoEventWireup="true"
> > CodeFile="Default.aspx.cs" Inherits="_Default" %>
> >
> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> >
> > <html xmlns="http://www.w3.org/1999/xhtml"; >
> > <head runat="server">
> >     <title>Untitled Page</title>
> > </head>
> > <body>
> >     <form id="form1" runat="server">
> >     <div>
> >
> >         <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
> >         <br />
> >         <asp:Button ID="Button1" runat="server"
> > onclick="Button1_Click" Text="Button" />
> >
> >     </div>
> >     </form>
> > </body>
> > </html>
> > ASPX.CS file
> > using System.Web.UI.HtmlControls;
> >
> > public partial class _Default : System.Web.UI.Page
> > {
> >     protected void Page_Load(object sender, EventArgs e)
> >     {
> >
> >     }
> >     protected void Button1_Click(object sender, EventArgs e)
> >     {
> >         TextBox1.Text = "Hello World";
> >     }
> >
> > }
> >
> > On Feb 10, 1:24 pm, Davej <[email protected]> wrote:
> >
> > > > On Thu, Feb 10, 2011 at 3:35 AM, Davej <[email protected]> wrote:
> > > > In ASP.NET can the code-behind aspx.vb files contain any VB.NETcode?
> > > > Thanks.
> >
> > > On Feb 10, 11:39 am, KeidrickP <[email protected]> wrote:
> >
> > > > sure it can..
> > > > what are you really trying to ask?
> >
> > > > On Thu, Feb 10, 2011 at 10:57 AM, Stephen Russell <
> [email protected]>wrote:
> >
> > > > > Please reread your question and then say I guess so.
> >
> > > I'm just getting started with ASP.NET and I don't know what I'm doing
> > > yet. I've never written console mode VB.NET code but I guess that is
> > > what you need to work with ASP.NET?
>

Reply via email to