ImageBrush b = new ImageBrush();
b.ImageSource = new BitmapImage(new Uri("../../Content/dropShadow.jpg",UriKind.Relative));
b.Stretch = Stretch.Fill;
this.Background = b;
..代表上一级
~/ 类似,不过只用服务端的空间可以识别;
/ 针对目录
./ 当前目录
../ 相对当前目录的上层目录
ImageBrush b = new ImageBrush();
b.ImageSource = new BitmapImage(new Uri("../../Content/dropShadow.jpg",UriKind.Relative));
b.Stretch = Stretch.Fill;
this.Background = b;
..代表上一级
~/ 类似,不过只用服务端的空间可以识别;
/ 针对目录
./ 当前目录
../ 相对当前目录的上层目录
转载于:https://www.cnblogs.com/jinhaoObject/p/4676551.html