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) { string location = @"D:\images.txt"; string path = System.IO.Path.Combine(location, picUserimage.Source + ".jpg"); picUserimage.Source = new BitmapImage(new Uri(location)); }
string text = @"file:\\\D:\images.png"; 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)); } txtActivationKey.Text = ds.Tables[0].Rows[0][12].ToString(); txtCreatedby.Text = ds.Tables[0].Rows[0][13].ToString(); txtDate.Text = ds.Tables[0].Rows[0][14].ToString(); conn.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)