Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. using Microsoft.Win32;
  16.  
  17. namespace IW5MoviesApp.UserControls
  18. {
  19. /// <summary>
  20. /// Interaction logic for AddMovieToDatabase.xaml
  21. /// </summary>
  22. public partial class AddMovieToDatabase : UserControl
  23. {
  24. public AddMovieToDatabase()
  25. {
  26. InitializeComponent();
  27. }
  28.  
  29. private void btnOpen_File_Click(object sender, RoutedEventArgs e)
  30. {
  31. string path = System.Reflection.Assembly.GetExecutingAssembly().Location;
  32. string sFileName;
  33. OpenFileDialog openFileDialog = new OpenFileDialog();
  34. openFileDialog.Filter = "Image files (*.png;*.jpeg;*.jpg)|*.png;*.jpeg;*.jpg|All files (*.*)|*.*";
  35. openFileDialog.InitialDirectory = path;
  36.  
  37. if (openFileDialog.ShowDialog() != true)
  38. sFileName = string.Empty;
  39. else
  40. {
  41. sFileName = openFileDialog.FileName;
  42. }
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement