string text = @"file:\\\D:\\acer.jpg"; text = text.Replace(@"file:\\\", @""); string userimagepath = AppDomain.CurrentDomain.BaseDirectory + text + ds.Tables[0].Rows[0][11].ToString(); if (!File.Exists(userimagepath)) { picUserimage.Source = BitmapFromUri(new Uri(text)); }
openFileDialog1.CheckFileExists = true; openFileDialog1.CheckPathExists = true; openFileDialog1.DefaultExt = ".jpg"; openFileDialog1.Filter = "jpg files (*.jpg)|*.jpg| PNG files (*.png)|*.png"; openFileDialog1.FilterIndex = 2; openFileDialog1.RestoreDirectory = true; if (openFileDialog1.ShowDialog() == true) { picUserimage.Source = new BitmapImage(new Uri("D:\\acer.jpg")); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)