Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using System.IO;
- using System.Security;
- namespace Test2
- {
- /// <summary>
- /// Interaction logic for Page1.xaml
- /// </summary>
- public partial class Page1 : Page
- {
- public Page1()
- {
- InitializeComponent();
- }
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- //Gets current date and puts it into string.
- string today = DateTime.Now.ToString("yyyy.MM.dd");
- string yesterday = DateTime.Now.AddDays(-1).ToString("yyyy.MM.dd");
- TextBoxToday.Text = "" + today;
- TextBoxYesterday.Text = "" + yesterday;
- try
- {
- FileInfo f = new FileInfo("D:\\Client1\\2011.02.14.log");
- {
- if (f.Length > 0)
- ButtonToday.Background = Brushes.Green;
- else
- ButtonToday.Background = Brushes.Red;
- }
- }
- catch (SecurityException ex)
- {
- MessageBox.Show("" + ex);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement