小编Eno*_*yne的帖子

获取"找不到路径的一部分"错误

我在我的Web应用程序中使用FileUploader控件.我想将文件上传到指定的文件夹中.由于特定文件夹尚不存在,我必须在我的代码中创建它的路径.

Could not find part of the path.
mscorlib.dll but was not handled in user code

Additional information: Could not find a part of the path
'C:\Users\seldarine\Desktop\PROJ\ED_Project\SFiles\Submissions\blueteam\Source.zip
Run Code Online (Sandbox Code Playgroud)

我相信我的filePath存在问题.这是我的代码的一部分:

 //teamName is a string passed from a session object upon login 
 string filePath = "SFiles/Submissions/" + teamName+ "/";

 //If directory does not exist
 if (!Directory.Exists(filePath))
 { // if it doesn't exist, create

    System.IO.Directory.CreateDirectory(filePath);
 }

 f_sourceCode.SaveAs(Server.MapPath(filePath + src));
 f_poster.SaveAs(Server.MapPath(filePath + bb));
Run Code Online (Sandbox Code Playgroud)

c# asp.net directory file-upload file

4
推荐指数
1
解决办法
3万
查看次数

投票数据库设计

我正在实现一种投票功能,以允许用户对自己喜欢的图像进行投票。他们只能投票3张图像。或多或少。因此,我正在使用复选框对其进行验证。我需要将这些选票存储在数据库中。

这是我到目前为止所拥有的:

| voteID | 名称| emailAddress | ICNo | imageID

(其中imageID是Images表的外键)

我仍在学习数据库系统,考虑到某些字段(例如电子邮件地址和IC编号)必须重复,因此我觉得这不是一个好的数据库设计。

例如,

|voteID | name|   emailAddress     |   ICNo      |  imageID
   1      BG    email@example.com    G822A28A          10
   2      BG    email@example.com    G822A28A          11
   3      BG    email@example.com    G822A28A          12
   4      MO    email2@example.com   G111283Z          10 
Run Code Online (Sandbox Code Playgroud)

database voting voting-system

2
推荐指数
1
解决办法
936
查看次数

标签 统计

asp.net ×1

c# ×1

database ×1

directory ×1

file ×1

file-upload ×1

voting ×1

voting-system ×1