Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- namespace ST_f70ca8889a244cbfa56af3a42878c645
- {
- [Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
- public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
- {
- public void Main()
- {
- bool fireAgain = false;
- //Get Drives info
- Dts.Events.FireInformation(3, "Drives", "Drives - Begin", "", 0, ref fireAgain);
- foreach (DriveInfo d in DriveInfo.GetDrives())
- {
- if (d.IsReady)
- {
- string info = String.Format("Name: \"{0}\", Label: \"{1}\", Total size: {2}Gb, Available free space: {3}Gb", d.Name, d.VolumeLabel, d.TotalSize / 1024 / 1024 / 1024, d.AvailableFreeSpace / 1024 / 1024 / 1024);
- Dts.Events.FireInformation(3, "Drives", " | " + info, "", 0, ref fireAgain);
- }
- }
- Dts.Events.FireInformation(3, "Drives", "Drives - End", "", 0, ref fireAgain);
- }
- }
- #region ScriptResults declaration
- /// <summary>
- /// This enum provides a convenient shorthand within the scope of this class for setting the
- /// result of the script.
- ///
- /// This code was generated automatically.
- /// </summary>
- enum ScriptResults
- {
- Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
- Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
- };
- #endregion
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement