Use namespace System.IO
VB.NET
File.Move(\\'C:Dir1SomeFile.txt\\', \\'C:Dir1RenamedFileName.txt\\')
C#
File.Move(@\\'C:Dir1SomeFile.txt\\', @\\'C:Dir1RenamedFileName.txt\\')
Refer
Rename Function
FileInfo.MoveTo Method
Note: In a Web application, the code is running in the context of the machineASPNET account, which has limited privileges. If the error you are getting pertains to permissions, you might need to grant to the machineASPNET account the rights to create and delete files in the directory where you’re working. Note that this could be a security issue.