Get a CSS project schedules
C# Code:
CReplicationServer cssSvr = new CReplicationServerClass();cssSvr.Initialize(Environment.MachineName);// project nameCReplicationProject csPrj = (CReplicationProject)cssSvr.OpenProject("Test", CSS_PROJECT_CREATION.OPEN_EXISTING_PROJECT);object dummy = new object();dummy = 0;while ((int)dummy != -1){ CReplicationSchedule csSchd = (CReplicationSchedule)csPrj.EnumSchedules(ref dummy); Console.WriteLine(csSchd.Description.ToString());} |
VBScript Code:
Option Explicit On Error Resume Nextdim ReplServerset ReplServer = CreateObject("CssApi.ReplicationServer")ReplServer.Initialize("")dim Projectdim Iteratordim ReplProjectdim scheddim dummydim ReplErrorIterator = 0'Clear any error textErr.Clear'Get the projectset ReplProject = ReplServer.OpenProject("Test", 2)do while true 'Clear any error text Err.Clear if(Iterator <>-1) then set sched = ReplProject.EnumSchedules(Iterator) 'Display error message and 'Quit if empty object returned (no more instances) if IsEmpty(sched) then Wscript.Echo "Empty project object returned." exit do end if ReplError = Err.Number if Err.Number <> 0 then 'Display error message and quit Wscript.Echo "Error Description: " & Err.Description & "Error Number: " & Err.Number exit do end if Wscript.Echo "Schedule Name: " & sched.Description end ifLoop |
Comments
- Anonymous
June 01, 2009
PingBack from http://indoorgrillsrecipes.info/story.php?id=3276