Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set safety
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01356988
Message ID:
01356997
Views:
15
>In VFP there is a command SET SAFETY OFF that will allow you to overwrite an existing file without throwing an error or exception. Is there an equivalent in .NET VB?
>
>Thanks

It depends. How are you writing this information to an existing file?

For example, if you are copying a file:
System.IO.File.Copy(source, dest, true); // third param. tells it to overwrite
In other cases, you may need to delete the file first.
System.IO.File.Delete(file);
And there are other classes which overwrite by default.
System.IO.File.WriteAllText(path, textToWrite);
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform