我自己创建了一个使用资源文件---但是有点小问题!!!!

qaqaqa 2002-02-09 12:30:39
我自己创建了一个使用资源文件,先向其中写入image okoff。但是怎么读不出来..同时提示。。高手提携一下!!!
private void button27_Click(object sender, System.EventArgs e)
{
//String x=new string(' ',200);
//uint i=200;int j;
//j=GetWindowText(this.Handle,x,i);
//button1.Text=x;
//------------------
ResourceWriter rw = new ResourceWriter ( "My.resources" ) ;
rw.AddResource ( "MyStr" , "从资源文件中读取字符串!" );
Image okoff = Image.FromFile ( "1.bmp" ) ;
rw.AddResource ( "1.bmp" ,okoff ) ;
rw.Generate ( ) ;
rw.Close();

ResourceManager rm = new ResourceManager ("Images",Assembly.GetExecutingAssembly ( ) ) ;
this.button1.Image = ( ( System.Drawing.Bitmap) ( rm.GetObject ( "1.bmp" ) ) ) ;//-----error
//提示:baseName: Images locationInfo: <null> resource file name: Images.resources assembly: API_test, Version=1.0.770.651, Culture=neutral, PublicKeyToken=null

}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...全文
23 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
qaqaqa 2002-02-11
  • 打赏
  • 举报
回复
up
qaqaqa 2002-02-09
  • 打赏
  • 举报
回复
up
qaqaqa 2002-02-09
  • 打赏
  • 举报
回复
HELP

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧