如何使用asp.net在xml中存储和检索图像 [英] how to store and retrive an image in xml using asp.net

查看:58
本文介绍了如何使用asp.net在xml中存储和检索图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我先生在使用c#

please can u help me sir to store and retreive an image in using asp.net with c#

推荐答案

^ ]




请查看codeproject中的本文以了解您的要求.

http://www.codeproject.com/KB/aspnet/Image_to_Xml_File.aspx


最好的
Hi,

Check this article in codeproject for your requirement.

http://www.codeproject.com/KB/aspnet/Image_to_Xml_File.aspx


All the Best




这里''m证明了一些使用c#
在服务器端存储任何文件的代码
Hi,

Here ''m proving some code for storing any file in server side using c#

   if(FileUpload1.HasFile)
{
        string ext=Path.GetExtension(FileUpload1.FileName);
                if (ext == ".jpg" || ext == "png")
                {
 FileUpload1.saveas(server.Mappath("~/Images")+"/"+FileUpload1.FileName);
                }
   
    
}



通过使用以上代码,您可以将任何文件保存在Images文件夹中.还可以添加其他文件扩展名.

检索过程也与存储相同.

代码是



By using above code you can save any file in Images folder.You can add another file extenssions also.

And retrieving process is also same as storing.

code is

Image1.ImageUrl=Server.MapPath("~/Images/"+filename);



在上面的代码中,无论您要检索什么,都可以将图像名称指定为文件名.


最好的



In the above code you can give image name as filename whatever you want to retrieve.


All the Best


这篇关于如何使用asp.net在xml中存储和检索图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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