×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: C#
Posted by: shamash kunnath
Added: Jun 16, 2016 7:36 AM
Views: 9
Tags: no tags
  1.   private static void SetVolumeLabel(string newLabel)
  2.         {
  3.             DriveInfo[] allDrives = DriveInfo.GetDrives();
  4.             foreach (DriveInfo d in allDrives)
  5.             {
  6.                 if (d.IsReady && d.DriveType == DriveType.Removable)
  7.                 {
  8.                     d.VolumeLabel = newLabel;
  9.                 }
  10.             }
  11.         }