且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用C#在Asp.Net中实现此功能

更新时间:2021-08-21 00:47:44

对于Web应用程序,***的解决方案可能是在服务器端主机文件系统中存储图像。你可以给他们一些独特的名字。创建一些生成唯一名称的代码。这很简单,因为名称必须仅在用于存储图像文件的某个子目录的范围内是唯一的。然后,您只需要存储相对于此目录的文件名。例如,对于平面目录结构,它只是没有路径的简单文件名。它可以在一些普通数字之后命名。



这样定义的文件名可以存储在数据库中。



-SA
For a Web application, perhaps the best solution would be store images in the server-side host file system. You can give them all some unique names. Create some code generating unique names. This is easy, because the names have to be unique only in the scope of some sub-directory you use to store the image files. Then you would need to store just the file names relative to this directory. For example, for flat directory structure, it would be just simple file names without paths. It could be named just after some ordinary numbers.

And the file names defined this way can be stored in the database.

—SA