You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/storage/files/storage-dotnet-how-to-use-files.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -412,6 +412,11 @@ You can copy a file to a destination blob by using the following method from a `
412
412
The following code example shows how to copy a file to a file in another file share:
413
413
414
414
```csharp
415
+
using Azure.Core;
416
+
using Azure.Identity;
417
+
using Azure.Storage.Files.Shares;
418
+
using Azure.Storage.Files.Shares.Models;
419
+
415
420
string accountName = "<account-name>";
416
421
string srcShareName = "src-file-share";
417
422
string destShareName = "dest-file-share";
@@ -447,6 +452,12 @@ A lease creates a lock on a file that's managed by Azure via a lease ID. The lea
447
452
The following code example shows how to create a lease client, acquire a infinite duration lease on a file, and release the lease:
448
453
449
454
```csharp
455
+
using Azure.Core;
456
+
using Azure.Identity;
457
+
using Azure.Storage.Files.Shares;
458
+
using Azure.Storage.Files.Shares.Models;
459
+
using Azure.Storage.Files.Shares.Specialized;
460
+
450
461
string accountName = "<account-name>";
451
462
string shareName = "sample-file-share";
452
463
string filePath = "path/to/file";
@@ -483,6 +494,9 @@ Share snapshots are read-only copies of a file share at a point in time. You can
483
494
The following code example shows how to create a share snapshot, list the snapshots in a file share, and traverse the directory tree in a share snapshot:
484
495
485
496
```csharp
497
+
using Azure.Storage.Files.Shares;
498
+
using Azure.Storage.Files.Shares.Models;
499
+
486
500
string connectionString = "<connection-string>";
487
501
488
502
ShareServiceClient shareServiceClient = new ShareServiceClient(connectionString);
@@ -544,6 +558,13 @@ The management libraries are recommended for operations that are performed at th
544
558
The following code example shows how to create a top-level `ArmClient` object, register the Storage resource provider with a subscription, and create a file share using the Azure Storage management library:
545
559
546
560
```csharp
561
+
using Azure;
562
+
using Azure.Core;
563
+
using Azure.Identity;
564
+
using Azure.ResourceManager;
565
+
using Azure.ResourceManager.Resources;
566
+
using Azure.ResourceManager.Storage;
567
+
547
568
ArmClient armClient = new ArmClient(new DefaultAzureCredential());
548
569
549
570
// Create a resource identifier, then get the subscription resource
0 commit comments