Exemplo n.º 1
0
        public FileShareWorker(StorageAccountCredentials credentials)
        {
            StorageCredentials storageCredentials = new StorageCredentials(credentials.AccountName, credentials.AccessKey);
            StorageUri         fileStorageUri     =
                new StorageUri(
                    new Uri(string.Concat(@"https://", credentials.AccountName, @".file.core.windows.net/")));
            CloudStorageAccount storageAccount = new CloudStorageAccount(storageCredentials, null, null, null, fileStorageUri);
            CloudFileClient     fileClient     = storageAccount.CreateCloudFileClient();

            _share = fileClient.GetShareReference(credentials.FileShareName);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            StorageAccountCredentials credentials = new StorageAccountCredentials();

            credentials.AccessKey     = "";
            credentials.AccountName   = "";
            credentials.FileShareName = "";
            FileShareWorker worker = new FileShareWorker(credentials);

            worker.Init();
            worker.GetVolumeLabel();
            //worker.SetVolumeLabel("datadisk");
            worker.GetDirectoryContent(".", "*");
        }