C Sharp (C#) - File IOWhich File class static method is used to copy a file from one location to another in C#?AFile.Delete(fileName)BFile.Move(sourceFileName, destFileName)CFile.Copy(sourceFileName, destFileName)DFile.ReadAllText(fileName)Check Answer
Step-by-Step SolutionSolution:Step 1: Understand the purpose of each methodFile.Copy copies a file, File.Move moves it, File.Delete deletes, and File.ReadAllText reads content.Step 2: Match the method to copying filesOnly File.Copy copies a file from one location to another.Final Answer:File.Copy(sourceFileName, destFileName) -> Option CQuick Check:Copy file method = File.Copy [OK]Quick Trick: Use File.Copy to duplicate files easily [OK]Common Mistakes:MISTAKESConfusing File.Move with File.CopyUsing File.Delete to copy filesTrying to read file content to copy
Master "File IO" in C Sharp (C#)9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More C Sharp (C#) Quizzes Classes and Objects - Why classes are needed - Quiz 9hard Classes and Objects - Object instantiation with new - Quiz 6medium Exception Handling - When clause in catch - Quiz 12easy Exception Handling - Exception hierarchy in .NET - Quiz 9hard Interfaces - Explicit interface implementation - Quiz 12easy Interfaces - Implementing interfaces - Quiz 3easy Polymorphism and Abstract Classes - Abstract classes and methods - Quiz 8hard Properties and Encapsulation - Property validation logic - Quiz 10hard Strings and StringBuilder - String comparison and equality - Quiz 15hard Strings and StringBuilder - Common string methods - Quiz 3easy