StringWriter.ToString Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Retourne une chaîne contenant les caractères écrits jusqu’à présent dans le courant StringWriter .
public:
override System::String ^ ToString();
public override string ToString();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
Retours
Chaîne contenant les caractères écrits dans le fichier actif StringWriter.
Exemples
Cet exemple de code fait partie d’un exemple plus large fourni pour le StringWriter(IFormatProvider) constructeur.
Console.WriteLine(
"Current date and time using the invariant culture: {0}\n" +
"Current date and time using the Algerian culture: {1}",
DateTime.Now.ToString(), strWriter.ToString());
Console.WriteLine( _
"Current date and time using the invariant culture: {0}" _
& vbCrLf & _
"Current date and time using the Algerian culture: {1}", _
DateTime.Now.ToString(), strWriter.ToString())
Remarques
Le tableau suivant répertorie des exemples d’autres tâches d’E/S classiques ou connexes.
| Pour ce faire... | Consultez l’exemple de cette rubrique... |
|---|---|
| Créez un fichier texte. | Guide pratique pour écrire du texte dans un fichier |
| Écrire dans un fichier texte. | Guide pratique pour écrire du texte dans un fichier |
| Lire à partir d’un fichier texte. | Guide pratique pour lire du texte à partir d’un fichier |