using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace AndroidWeb
{
public partial class UploadSimple : System.Web.UI.Page
{
// <MyProject>/.vs/config/applicationhost.config
// <MyUser>/Documents/IISExpress/config/applicationhost.config
// <binding protocol="http" bindingInformation=":8080:*" />
protected void Page_Load(object sender, EventArgs e)
{
String uploadDirectory = Server.MapPath("~/UploadDirectory");
if (fileUpload.HasFile) {
try {
fileUpload.PostedFile.SaveAs(uploadDirectory + "/" + fileUpload.FileName);
messageLabel.Text = "Dosya bindirildi";
} catch (Exception ex) {
messageLabel.Text = "Yanlışlık oldu \n" + ex.StackTrace;
}
} else {
messageLabel.Text = "Dosya eksik ";
}
}
}
}
Dosyayı İndir