Skip to content

Commit d4259cc

Browse files
imba-tjdmairaw
authored andcommitted
Update metadata and example (#9097)
* Update file-path-formats.md * Update file-path-formats.md * Update file-path-formats.md * Update handling-io-errors.md * Revert "Update file-path-formats.md" This reverts commit 1c7946f. * Changed example filenames
1 parent f245b17 commit d4259cc

File tree

2 files changed

+9
-25
lines changed

2 files changed

+9
-25
lines changed

docs/standard/io/file-path-formats.md

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
title: "File path formats on Windows systems"
33
ms.date: "06/28/2018"
44
ms.technology: dotnet-standard
5+
dev_langs:
6+
- "csharp"
7+
- "vb"
58
helpviewer_keywords:
69
- "I/O, long paths"
710
- "long paths"
@@ -207,29 +210,7 @@ Directory.Create("TeStDiReCtOrY")
207210

208211
creates a directory named TeStDiReCtOrY. If you rename a directory or file to change its case, the directory or file name reflects the case of the string used when you rename it. For example, the following code renames a file named test.txt to Test.txt:
209212

210-
```csharp
211-
using System;
212-
using System.IO;
213-
214-
class Example
215-
{
216-
public static void Main()
217-
{
218-
var fi = new FileInfo(@".\test.txt");
219-
fi.MoveTo(@".\Test.txt");
220-
}
221-
}
222-
```
223-
224-
```vb
225-
Imports System.IO
226-
227-
Module Example
228-
Public Sub Main()
229-
Dim fi As New FileInfo(".\test.txt")
230-
fi.MoveTo(".\Test.txt")
231-
End Sub
232-
End Module
233-
```
213+
[!code-csharp[case-and-renaming](~/samples/snippets/standard/io/file-names/cs/rename.cs)]
214+
[!code-vb[case-and-renaming](~/samples/snippets/standard/io/file-names/vb/rename.vb)]
234215

235216
However, directory and file name comparisons are case-insensitive. If you search for a file named "test.txt", .NET file system APIs ignore case in the comparison. Test.txt, TEST.TXT, test.TXT, and any other combination of upper- and lowercase letters will match "test.txt".

docs/standard/io/handling-io-errors.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
title: "Handling I/O errors in .NET"
33
ms.date: "08/27/2018"
44
ms.technology: dotnet-standard
5+
dev_langs:
6+
- "csharp"
7+
- "vb"
58
helpviewer_keywords:
69
- "I/O, exception handling"
710
- "I/O, errors"
@@ -81,4 +84,4 @@ You can handle these using a `When` clause in a catch statement, as the followin
8184
- [Handling and throwing exceptions in .NET](../exceptions/index.md)
8285
- [Exception handling (Task Parallel Library)](../parallel-programming/exception-handling-task-parallel-library.md)
8386
- [Best practices for exceptions](../exceptions/best-practices-for-exceptions.md)
84-
- [How to use specific exceptions in a catch block](../exceptions/how-to-use-specific-exceptions-in-a-catch-block.md)
87+
- [How to use specific exceptions in a catch block](../exceptions/how-to-use-specific-exceptions-in-a-catch-block.md)

0 commit comments

Comments
 (0)