Tuesday, October 9, 2018

Create director on Run Time

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

    }
    protected void Button1_Click(object sender, EventArgs e)// create
button show
    {
        Directory.CreateDirectory(Request.MapPath(TextBox1.Text) + "/");
        ListBox1.Items.Add(TextBox1.Text);
    }
    protected void Button2_Click(object sender, EventArgs e)//file uplad
    {
        FileUpload1.SaveAs(Server.MapPath("~")+"//"+ListBox1.Text+"//"+FileUpload1.FileName);
        Image1.ImageUrl = "~/" + ListBox1.Text + "/" + FileUpload1.FileName;
    }

}

No comments:

Post a Comment

GRIDVIEW ON ROW DATA BOUND EVENT

 Database Create  Student : roll , name , city , cost  Fix 6 Value  in Database Record  ====================================================...