Click here to Skip to main content
15,891,607 members
Home / Discussions / C#
   

C#

 
QuestionWorking with dictionary Pin
SRKSHOME22-Feb-11 3:10
SRKSHOME22-Feb-11 3:10 
AnswerRe: Working with dictionary [modified] Pin
Luc Pattyn22-Feb-11 3:21
sitebuilderLuc Pattyn22-Feb-11 3:21 
GeneralRe: Working with dictionary Pin
Ennis Ray Lynch, Jr.22-Feb-11 6:43
Ennis Ray Lynch, Jr.22-Feb-11 6:43 
GeneralRe: Working with dictionary Pin
Luc Pattyn22-Feb-11 6:54
sitebuilderLuc Pattyn22-Feb-11 6:54 
Questionoperate the pc through voice command in c# Pin
aeman22-Feb-11 2:29
aeman22-Feb-11 2:29 
AnswerRe: operate the pc through voice command in c# Pin
Not Active22-Feb-11 2:39
mentorNot Active22-Feb-11 2:39 
AnswerRe: operate the pc through voice command in c# Pin
Keith Barrow22-Feb-11 3:19
professionalKeith Barrow22-Feb-11 3:19 
AnswerRe: operate the pc through voice command in c# Pin
#realJSOP22-Feb-11 3:24
mve#realJSOP22-Feb-11 3:24 
GeneralRe: operate the pc through voice command in c# Pin
aeman22-Feb-11 6:21
aeman22-Feb-11 6:21 
GeneralRe: operate the pc through voice command in c# Pin
Dave Kreskowiak22-Feb-11 7:51
mveDave Kreskowiak22-Feb-11 7:51 
GeneralRe: operate the pc through voice command in c# Pin
Not Active22-Feb-11 15:48
mentorNot Active22-Feb-11 15:48 
AnswerRe: operate the pc through voice command in c# Pin
Eddy Vluggen22-Feb-11 9:37
professionalEddy Vluggen22-Feb-11 9:37 
AnswerRe: operate the pc through voice command in c# Pin
_Maxxx_22-Feb-11 15:31
professional_Maxxx_22-Feb-11 15:31 
GeneralRe: operate the pc through voice command in c# Pin
aeman23-Feb-11 6:49
aeman23-Feb-11 6:49 
AnswerRe: operate the pc through voice command in c# Pin
Member 873075321-Apr-12 11:26
Member 873075321-Apr-12 11:26 
QuestionIframe page login not working fine in IE...,But working fine in Mozila browser..., Pin
Member 387988122-Feb-11 1:22
Member 387988122-Feb-11 1:22 
AnswerRe: Iframe page login not working fine in IE...,But working fine in Mozila browser..., Pin
Peter_in_278022-Feb-11 15:54
professionalPeter_in_278022-Feb-11 15:54 
QuestionHow to display Warning Message When Uploading a File.. Pin
Rocky2322-Feb-11 0:18
Rocky2322-Feb-11 0:18 
AnswerRe: How to display Warning Message When Uploading a File.. Pin
Luc Pattyn22-Feb-11 0:32
sitebuilderLuc Pattyn22-Feb-11 0:32 
GeneralRe: How to display Warning Message When Uploading a File.. [modified] Pin
Bernhard Hiller22-Feb-11 20:31
Bernhard Hiller22-Feb-11 20:31 
GeneralRe: How to display Warning Message When Uploading a File.. [Code Updated] Pin
Rocky2322-Feb-11 23:18
Rocky2322-Feb-11 23:18 
No in my Application, i can upload only a file of type *.txt or *.csv,

so could u tell me how can i display a message to the user, when he is uploading a file of (.txt or .csv)type only when that particular file is open in his machine..

As of now in my application, it makes the application crash if that uploading file is open in user machine..

please check my code here..

private void BtnBrowseClick(object sender, RoutedEventArgs e)
        {
            OpenFileDialog file1 = new OpenFileDialog { Multiselect = false, Filter = "All Supported Files |*.txt;*.csv|Text|*.txt|CSV |*.csv"};
            if (file1.ShowDialog() == true)
            {
                new FileInfo(file1.FileName);
                try
                {
                    using (Stream str = file1.OpenFile())
                    {
                        TextReader reader = new StreamReader(str);
                        reader.ReadToEnd();
                        txtFileName.Text = file1.FileName;
                        txtFileName.IsEnabled = false;

                    }
                }
                catch
                {
                    txtFileName.Text = file1.FileName;
                    txtFileName.IsEnabled = false;
                    MessageBox.Show("Please check the file has been Closed before you upload", "LRM..! Manual Feed File Upload");
                }
            }
        }


It is showing warning message if i change the security of that file,but it i think that is not a right way..
So could u tell me the solution, if it needed ignore my code and tell me with a new sample of code..

modified on Wednesday, February 23, 2011 6:03 AM

QuestionPreventing MDI child form from losing focus Pin
Dewald21-Feb-11 23:24
Dewald21-Feb-11 23:24 
AnswerRe: Preventing MDI child form from losing focus Pin
Mycroft Holmes22-Feb-11 0:07
professionalMycroft Holmes22-Feb-11 0:07 
GeneralRe: Preventing MDI child form from losing focus Pin
Wayne Gaylard22-Feb-11 0:44
professionalWayne Gaylard22-Feb-11 0:44 
GeneralRe: Preventing MDI child form from losing focus Pin
Dewald22-Feb-11 0:51
Dewald22-Feb-11 0:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.