如何使用C#在Asp.Net中实现此功能 [英] How Do I Implement This In Asp.Net Using C#

查看:70
本文介绍了如何使用C#在Asp.Net中实现此功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

所以我想要实现的是我应该在.aspx中设计一个页面,公司可以在其中添加他们的产品。因此产品的这些信息将存储在sql数据库中。现在该公司的徽标和产品图像应该上传/保存在域上,前提是这些图像应放在godaddy的自动创建目录中,此目录的名称应与sql表中的产品名称列相同。这该怎么做?我有可能实施吗?请告诉我步骤并给出一些指示来实现这个...

nbthe目录应该由服务器路径上的aspx页面中的代码创建



谢谢..

Hello all,
So what i want to achieve is i supposed to design one page in .aspx where the company can add their product. hence this information of product will get stored in sql database. now the logo of this company and product images are supposed to get uploaded/saved on domain provided that, these images should be get placed in the auto created directory on godaddy and this directory should have name same as the product name column from the sql table.how to do this? i this possible to implement? please tell me the steps and give some pointers to implement this...
n.b.the directory is supposed to be created by code behind in aspx page on the server path

thank you..

推荐答案

对于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


这篇关于如何使用C#在Asp.Net中实现此功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆