0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
public partial class _Default : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {


    }
    protected void Button_Click(object sender, EventArgs e)
    {
        string Filename = HttpContext.Current.Server.MapPath("~/textFile.txt");

        if (!File.Exists(Filename))
        {
            StreamWriter txtFile = File.CreateText(Filename);
            txtFile.Close();
            txtFile = File.AppendText(Filename);
            txtFile.WriteLine(Textbox.Text,"  ");
            txtFile.Close();
        }
        else
            File.AppendAllText(Filename, Textbox.Text);

        NewName.Text = "Text is saved";
        }
    }

unable to give space automatically after entering text to file

Edited by muhammad.ibraheem_1: uncomplete

2
Contributors
1
Reply
9
Views
3 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.