目前我所拥有的代码是生成类似的属性
private int integerProperty
{
get
{
return integerField;
}
set
{
integerField = value;
}
}
Run Code Online (Sandbox Code Playgroud)
我希望这些属性很简单......
private int integerProperty
{
get;
set;
}
Run Code Online (Sandbox Code Playgroud)
我和我的代码是
CodeMemberProperty property1 = new CodeMemberProperty();
property1.GetStatements.Add(new CodeMethodReturnStatement(new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), "integerField")));
property1.SetStatements.Add(new CodeAssignStatement(new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), "integerField"),new CodePropertySetValueReferenceExpression()));
type1.Members.Add(property1);
Run Code Online (Sandbox Code Playgroud)
有人请帮忙.提前致谢.
public static ReadMail()
{
ExchangeService Service = new ExchangeService();
Service.Credentials = new WebCredentials("", "", "");
Service.AutodiscoverUrl("xyz@xyz.com");
Folder inbox = Folder.Bind(Service, WellKnownFolderName.Inbox);
StreamingSubscription streamingsubscription = Service.SubscribeToStreamingNotifications(new FolderId[] { WellKnownFolderName.Inbox }, EventType.NewMail);
var connection = new StreamingSubscriptionConnection(Service, 30);
connection.AddSubscription(streamingsubscription);
connection.OnNotificationEvent += OnNotificationEvent;
connection.Open();
}
private static void OnNotificationEvent(object sender, NotificationEventArgs args)
{
Item mail = args.Subscription.Service.FindItems(WellKnownFolderName.Inbox, new ItemView(10)).Items[0];
}
Run Code Online (Sandbox Code Playgroud)
I'm connected to a mail account using exchange server(2007). I'm able to read the mail item. after i read & parse the mail …
我已经在.NET中安排了cron Job,并且在IIS中托管了该任务。在它触发的第一天(出于测试目的,我实际上在触发此作业时发送邮件)。但是第二天还没有(我希望每天进行递归……每24小时一次)请在下面找到代码。[![在此处输入图片描述] [1]] [1]
public class JobScheduler
{
public static void Start()
{
try
{
Logger.Error("-------------------------------------------Inside JobScheduler Start-------------------------------------------");
IScheduler scheduler = StdSchedulerFactory.GetDefaultScheduler();
scheduler.Start();
IJobDetail job = JobBuilder.Create<QualityGateSFDCActionJob>().Build();
ITrigger trigger = TriggerBuilder.Create().WithIdentity("trigger3", "group1").WithSchedule(CronScheduleBuilder.DailyAtHourAndMinute(11, 42)).ForJob(job).Build();
scheduler.ScheduleJob(job, trigger);
Logger.Error("-------------------------------------------Scheduler Started without Issues-------------------------------------------");
}
catch (Exception ex)
{
Logger.Error(ex.Message);
throw ex;
}
}
}
Run Code Online (Sandbox Code Playgroud)
一些对此的帮助。
ITrigger trigger = TriggerBuilder.Create().WithIdentity("trigger3", "group1").WithSchedule(CronScheduleBuilder.DailyAtHourAndMinute(11, 42)).ForJob(job).Build();
Run Code Online (Sandbox Code Playgroud)
我只希望这项工作每天早上11:42运行。非常感谢您在这方面的帮助
应用程序基于ASP.NET MVC构建,并托管在IIS上。我希望每天运行一份作业,这就是为什么我选择Cron Job(Windows服务在生产服务器中不在上下文/范围内)的原因