我是asp.net新手,我在.aspx页面中有上传文件控件,它工作得很好。但是,如果用户上传了新文件,我想从目录中删除以前上传的文件。
这是我的代码隐藏文件的抽象代码:
public partial class mypage : System.Web.UI.Page
{
//I cannot access upload label control value here
string lblValue = lbluploadFile.Text //this global variable doesn't work
protected void Page_Load(o
我使用asp.net核心web启动了一个带有spa模板的项目,并希望将图像上传到服务器(例如,用户化身),然后在客户端应用程序中显示图像。
上传没有任何问题,但我的问题是在哪里保存上传的图像?
ConfigureServices中的静态文件在startup.cs中有位置
// In production, the React files will be served from this directory
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/bu
我在webhost4life上托管了一个ASP.NET MVC应用程序
保存日志的好方法是什么?
我可以访问我上传网站的ftp,我应该有效地做吗?
File.AppendAllText("log.txt", "Ooops, we have an error" + e.Message);
还是有更好的方法?发送电子邮件?是否将日志保存到数据库?