文件中的图标图像

问题描述:

大家好,
我想从我的项目文件中显示googlemap图标.以下kod可以工作.
icon.image ="http://labs.google.com/ridefinder/images/mm_20_red.png";
但是,我想从图标文件中显示我的图标,它的名称是1.png.以下kod不起作用;
icon.image ="/icons/1.png";

icon.image =〜/icons/1.png";
无法使用,如何使用我的图标而不使用互联网上的图标?
请迅速提供帮助.

Hi Alls,
I want to show googlemap icon from my project file.The following kod works.
icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
but, I want to show my icon from icons file, its name is 1.png. The following kod does not work;
icon.image = "/icons/1.png";
or
icon.image = "~/icons/1.png";
does not work,how can I use my icon without using icon from internet?
Please help, quickly.

尝试:
icon.image = Server.MapPath("~/icons/1.png");


我已经尝试过了,但是这是行不通的.你知道其他方式吗?
谢谢
I''ve tried, but ıt''s not work. Do you know other way?
Thanks


我找到了正确的答案.我现在分享.我们只需要使用图标文件之前的点即可:以下代码有效.
icon.image ="./icons/1.png";
I have found the correct answer. I''m sharing now. We have to use only the point before icon file: The following code works.
icon.image = "./icons/1.png";