2011-08-02 40 views
0

我想为图像路径添加一个参数。否则,我会通过带整数的参数调用这些图像。 例如:picturebox路径参数

hamlekullanici.Image = Image.FromFile(@"images\\"+hamlekullanici+".png"); 

Username -- > hamle 
Variable -- > integer 

所以,我想显示不同的图像根据hamle number.How我能做到这一点?

回答

0

你可以使用string.Format为图像文件名创建字符串吗?喜欢的东西...

hamlekullanici.Image = Image.FromFile(
     string.Format(@"images\{0}{1}.png", username, number); 

...还是我误解你想要做什么?