15,911,789 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Pete_123 (Top 4 by date)
Pete_123
11-Jan-16 8:41am
View
No im using https://code.google.com/p/ftpexplorer/
Pete_123
23-Dec-15 6:32am
View
Okay so i have removed the second loop and the other variable but when i renames the file it doesnt append to the orignal name it complty over writes it?
File.Move(Path.Combine(sourcePath, fileName), Path.Combine(sourcePath, "(AF)"))
Pete_123
23-Dec-15 6:05am
View
Hi Phil I’m not quite understanding what you’re saying if I remove the second loop its un able to uses the original file name and add the Initials at the beginning or am I missing a step ?
Pete_123
23-Dec-15 5:52am
View
Hi Phil Yes I see what you mean when the code is executed it fires this error:
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
Additional information: Could not find file 'C:\Users\DaBeast\Desktop\PR\1.txt'.
dra {2.txt} System.IO.FileInfo
fileName "C:\Users\DaBeast\Desktop\PR\1.txt" String
sourcePath "C:\Users\DaBeast\Desktop\PR" String
I’m guessing in that due to there being two for loops one loop is ahead of the other causing this error.
in the folder it has already renamed 1.txt to (AF)1.txt which is correct but it then needs to rename 2.txt to (AF)2.txt