Replace the code with the following.
// search service application name
string
ssaName = "Search Service Application";
SearchContext context=
SearchContext.GetContext(ssaName);
//
Represents a crawl schedule used to specify the number of days between
crawls
DailySchedule daily =
new
DailySchedule(context);
daily.BeginDay = 25;
daily.BeginMonth = 1;
daily.BeginYear = 2010;
daily.StartHour = 2;
daily.StartMinute = 30;
daily.DaysInterval = 1;
//
Represents a crawl schedule used to specify the number of weeks between
crawls.
WeeklySchedule weekly =
new
WeeklySchedule(context);
weekly.BeginDay = 25;
weekly.BeginMonth = 1;
weekly.BeginYear = 2010;
weekly.StartHour = 23;
weekly.StartMinute = 15;
weekly.WeeksInterval = 1;
Content ssaContent =
new Content(context);
ContentSourceCollection
ssaContentSources = ssaContent.ContentSources;
// Getting the content source
ContentSource cs =
ssaContentSources["Local SharePoint Sites"];
// Incremental Crawl Schedule
cs.IncrementalCrawlSchedule = daily;
// Full Crawl Schedule
cs.FullCrawlSchedule = weekly;
cs.Update();