Click here to Skip to main content
15,905,915 members
Home / Discussions / C#
   

C#

 
AnswerRe: File creation and naming increment Pin
PIEBALDconsult21-Jan-09 5:20
mvePIEBALDconsult21-Jan-09 5:20 
AnswerRe: File creation and naming increment Pin
Tom Deketelaere21-Jan-09 5:31
professionalTom Deketelaere21-Jan-09 5:31 
AnswerRe: File creation and naming increment Pin
User 665821-Jan-09 5:45
User 665821-Jan-09 5:45 
AnswerRe: File creation and naming increment [modified] Pin
Luc Pattyn21-Jan-09 5:56
sitebuilderLuc Pattyn21-Jan-09 5:56 
GeneralRe: File creation and naming increment Pin
User 665821-Jan-09 7:17
User 665821-Jan-09 7:17 
GeneralRe: File creation and naming increment Pin
Terick21-Jan-09 6:16
Terick21-Jan-09 6:16 
GeneralRe: File creation and naming increment Pin
User 665821-Jan-09 7:29
User 665821-Jan-09 7:29 
GeneralRe: File creation and naming increment Pin
riced22-Jan-09 4:28
riced22-Jan-09 4:28 
This won't work - in fact I don't think it will compile.
1 The return type is void but the function tries to return a string.
2 The parameter name (file) conflicts with the local variable also called file.
3 The value of y is not set but is used to construct the file name.

Couple of other comments.
1 Why use the x and y variables when you have filepaths. You could just set it to Directory.GetFiles(@"C:\Desktop\Request", "*txt").Length + 1. Then use it instead of x or y.
2 This approach does not deal with deleted files. Suppose there are three files originally (text1.txt, text2.txt, text3.txt). Then text1.txt is deleted. What will the file count be?
3 The function is named filecount but it actually tries to return the next filename.
4 Read some of the suggestions carefully - there's good stuff in them that should solve the problem.

Regards
David R
AnswerThis post is not addressing your question but ... Pin
Ennis Ray Lynch, Jr.21-Jan-09 6:04
Ennis Ray Lynch, Jr.21-Jan-09 6:04 
GeneralRe: This post is not addressing your question but ... Pin
Terick21-Jan-09 6:26
Terick21-Jan-09 6:26 
GeneralRe: This post is not addressing your question but ... Pin
Ennis Ray Lynch, Jr.21-Jan-09 6:30
Ennis Ray Lynch, Jr.21-Jan-09 6:30 
GeneralRe: This post is not addressing your question but ... Pin
PIEBALDconsult21-Jan-09 7:54
mvePIEBALDconsult21-Jan-09 7:54 
GeneralRe: This post is not addressing your question but ... Pin
Ennis Ray Lynch, Jr.21-Jan-09 8:28
Ennis Ray Lynch, Jr.21-Jan-09 8:28 
GeneralRe: This post is not addressing your question but ... Pin
PIEBALDconsult21-Jan-09 8:31
mvePIEBALDconsult21-Jan-09 8:31 
GeneralRe: This post is not addressing your question but ... Pin
Ennis Ray Lynch, Jr.21-Jan-09 8:34
Ennis Ray Lynch, Jr.21-Jan-09 8:34 
GeneralRe: This post is not addressing your question but ... Pin
PIEBALDconsult21-Jan-09 8:37
mvePIEBALDconsult21-Jan-09 8:37 
GeneralRe: This post is not addressing your question but ... Pin
Ennis Ray Lynch, Jr.21-Jan-09 8:38
Ennis Ray Lynch, Jr.21-Jan-09 8:38 
GeneralRe: This post is not addressing your question but ... Pin
Terick21-Jan-09 9:44
Terick21-Jan-09 9:44 
GeneralRe: This post is not addressing your question but ... Pin
PIEBALDconsult21-Jan-09 11:18
mvePIEBALDconsult21-Jan-09 11:18 
GeneralRe: This post is not addressing your question but ... Pin
Ennis Ray Lynch, Jr.21-Jan-09 9:48
Ennis Ray Lynch, Jr.21-Jan-09 9:48 
QuestionReference syntax Pin
kanchoette21-Jan-09 4:13
kanchoette21-Jan-09 4:13 
AnswerRe: Reference syntax Pin
Eddy Vluggen21-Jan-09 4:46
professionalEddy Vluggen21-Jan-09 4:46 
GeneralRe: Reference syntax Pin
kanchoette21-Jan-09 21:30
kanchoette21-Jan-09 21:30 
QuestionInserting XML file in SQL db Pin
KppsK21-Jan-09 3:46
KppsK21-Jan-09 3:46 
AnswerRe: Inserting XML file in SQL db Pin
DanB198321-Jan-09 5:45
DanB198321-Jan-09 5:45 

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.