Click here to Skip to main content
15,884,991 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to call a method in web service without adding service reference to the code Pin
Ron Beyer26-Jun-13 16:24
professionalRon Beyer26-Jun-13 16:24 
QuestionGenerating properties of a class dynamically Pin
0bx26-Jun-13 12:19
0bx26-Jun-13 12:19 
AnswerRe: Generating properties of a class dynamically Pin
Ron Beyer26-Jun-13 14:37
professionalRon Beyer26-Jun-13 14:37 
GeneralRe: Generating properties of a class dynamically Pin
0bx26-Jun-13 16:11
0bx26-Jun-13 16:11 
GeneralRe: Generating properties of a class dynamically Pin
Ron Beyer26-Jun-13 16:18
professionalRon Beyer26-Jun-13 16:18 
GeneralRe: Generating properties of a class dynamically Pin
Freak3027-Jun-13 2:47
Freak3027-Jun-13 2:47 
GeneralRe: Generating properties of a class dynamically Pin
0bx28-Jun-13 3:01
0bx28-Jun-13 3:01 
QuestionC# select excel file from directory path Pin
classy_dog26-Jun-13 10:56
classy_dog26-Jun-13 10:56 
In a C# 2010 desktop application, I want to change the application so that it will only allow users to select a
report that meets the following criteria:
1. part of the file name is "ErrorReport" and
2. The last node of the file name is .xlsx or .xls.

So far I have the following code:
string[] excelFiles = Directory.GetFiles(strDirectoryLoc, "*ErrorReport*")
                                         .Select(path => Path.GetFileName(path))
                                         .Where(x => (x.EndsWith(".xlsx") || x.EndsWith(".xls"))
                                                   && (!x.StartsWith("~")))
                                         .ToArray();

This code works when I am selecting only excel (*.xls or *.xlsx) files.

The problem occurs if the user selects a .pdf file iniitally and there is actually a file in the directory path
that meets the criteria I listed above. The code will ignore the .pdf file the user selects and will actually use the
excel file that is in the directory path.

Thus how can I change the code listed above to say the .pdf file is invalid?
AnswerRe: C# select excel file from directory path Pin
Ron Beyer26-Jun-13 15:26
professionalRon Beyer26-Jun-13 15:26 
Question2 way events Pin
bfis10813726-Jun-13 8:56
bfis10813726-Jun-13 8:56 
AnswerRe: 2 way events Pin
Ron Beyer26-Jun-13 9:12
professionalRon Beyer26-Jun-13 9:12 
GeneralRe: 2 way events Pin
bfis10813726-Jun-13 10:34
bfis10813726-Jun-13 10:34 
AnswerRe: 2 way events Pin
Dave Kreskowiak26-Jun-13 12:10
mveDave Kreskowiak26-Jun-13 12:10 
GeneralRe: 2 way events Pin
bfis10813726-Jun-13 16:43
bfis10813726-Jun-13 16:43 
QuestionC# obtain db values from app.config of program accessed by a dll Pin
classy_dog26-Jun-13 7:11
classy_dog26-Jun-13 7:11 
AnswerRe: C# obtain db values from app.config of program accessed by a dll Pin
NickPace26-Jun-13 12:07
NickPace26-Jun-13 12:07 
QuestionPassing boolean parameter to an oracle procedure Pin
Subin Mavunkal26-Jun-13 3:39
Subin Mavunkal26-Jun-13 3:39 
AnswerRe: Passing boolean parameter to an oracle procedure Pin
NotPolitcallyCorrect26-Jun-13 3:56
NotPolitcallyCorrect26-Jun-13 3:56 
GeneralRe: Passing boolean parameter to an oracle procedure Pin
Subin Mavunkal26-Jun-13 4:03
Subin Mavunkal26-Jun-13 4:03 
GeneralRe: Passing boolean parameter to an oracle procedure Pin
NotPolitcallyCorrect26-Jun-13 4:05
NotPolitcallyCorrect26-Jun-13 4:05 
GeneralRe: Passing boolean parameter to an oracle procedure Pin
Subin Mavunkal26-Jun-13 4:07
Subin Mavunkal26-Jun-13 4:07 
GeneralRe: Passing boolean parameter to an oracle procedure Pin
NotPolitcallyCorrect26-Jun-13 4:10
NotPolitcallyCorrect26-Jun-13 4:10 
GeneralRe: Passing boolean parameter to an oracle procedure Pin
Subin Mavunkal26-Jun-13 4:36
Subin Mavunkal26-Jun-13 4:36 
AnswerOracle doesn't have a boolean type Pin
Ennis Ray Lynch, Jr.26-Jun-13 6:34
Ennis Ray Lynch, Jr.26-Jun-13 6:34 
QuestionVisual Studio 2010 Database Web Application Pin
Mausam Bharati26-Jun-13 2:17
Mausam Bharati26-Jun-13 2:17 

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.