Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set safety
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01356988
Message ID:
01356997
Vues:
16
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform