![](/img/trans.png)
[英]Compile error: 'The type or namespace name 'Runtime' does not exist in the namespace 'MyAppNamespace.System' (are you missing an assembly reference?)'
[英]Compiler error:The type or namespace name 'Core' does not exist in the namespace 'System' (are you missing an assembly reference?)
我嘗試在我的項目中將圖像上傳到c#中,並且提交按鈕中的代碼如下
FileUpload1.SaveAs(
Server.MapPath("Photos\\" +
System.Core.WebSecurity.GetUserName(Request) + ".jpg"));
Response.Write(
"<html> <script> alert ( 'you have successfully uploaded' ); </script></html>");
Response.Redirect("studentcreated.aspx");
但在編譯時顯示為
類型或名稱空間名稱'Core'在名稱空間'System'中不存在(您是否缺少程序集引用?)。
然后,我嘗試通過添加system.core來解決此問題。 但是它仍然顯示相同的錯誤。 我正在使用vs2008 asp3.5。
嘗試獲取用戶名: User.Identity.Name
編輯:添加此引用: using System.Web.Security;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.