Results 1 to 2 of 2

Thread: ASP.NET File

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Toronto, Ontario, Canada
    Posts
    275

    ASP.NET File

    Hey,

    I ahve a asp.net web page. I want it to edit a file on the server. How could I do this?

    I tried this code :

    Code:
            Dim file_name As String = ("http://localhost/cassgroupmainpage/" & ListBox1.SelectedValue & "/" & ListBox2.SelectedValue & ".xml")
            Dim stream_reader As New IO.StreamReader(file_name)
            Dim a As String
            a = stream_reader.ReadToEnd()
            stream_reader.Close()
            a = Replace(a, "</posts>", "")
            Dim b As String
            b = "<post>"
            b = (b + vbCrLf + "Posted by" + TextBox4.Text + vbCrLf + vbCrLf + "Posted date " + System.DateTime.Today() + vbCrLf + "Message : " + vbCrLf + TextBox2.Text + "</post>" + vbCrLf + "</posts>")
            Dim file_name1 As String = ("http://localhost/cassgroupmainpage/" & ListBox1.SelectedValue & "/" & ListBox2.SelectedValue & ".xml")
            Dim stream_writer As New IO.StreamWriter(file_name1, False)
            stream_writer.Write(b)
            stream_writer.Close()
    I'm new to coding ASP.NET (vb).

    Thanks,

    Matt Cassell

    yes i have the perminssions set.

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    post in the asp.net forum
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width