Googleカレンダー経由でSMSを送信します

最近、PHPのGoogleカレンダーでSMS通知+イベントログの記事に出会いました

そして、私はこの自転車を理解することも決めました


何が必要ですか?

1. Google APIを参照する

次のライブラリをプロジェクトに接続する必要があります



2.少しのコード。

internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  1. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  2. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  3. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  4. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  5. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  6. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  7. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  8. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  9. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  10. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  11. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  12. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  13. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  14. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  15. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  16. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  17. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  18. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  19. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  20. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  21. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  22. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  23. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  24. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  25. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  26. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  27. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
  28. internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .
internal class Sms { readonly Uri postUri = new Uri ( "http://www.google.com/calendar/feeds/default/private/full" ); private readonly CalendarService service = new CalendarService( "Zabr-SMSSender-1.0" ); private readonly EventEntry entry = new EventEntry(); private static Reminder MyReminder { get { Reminder reminder = new Reminder(); reminder.Minutes = 1; reminder.Method = Reminder.ReminderMethod.sms; return reminder; } } public void SendSmsFromGoogle( string Login, string Password, string Topic, string Message, DateTime StartDate, DateTime EndDate) { service.setUserCredentials(Login, Password); entry.Service = service; entry.Authors.Add( new AtomPerson(AtomPersonType.Author)); entry.Title.Text = Topic; entry.Content.Content = Message; entry.Times.Add( new When(StartDate.AddMinutes(3), EndDate.AddMinutes(5))); entry.Reminder = MyReminder; service.Insert(postUri, entry); } } * This source code was highlighted with Source Code Highlighter .


その後、次のようにクラシックを使用できます。

  1. Sms sms = 新しい Sms()
  2. sms.SendSmsFromGoogle(txtLogin、txtPasswd、txtTopic、txtMessage、 DateTime .Now、 DateTime .Now);




MyReminderのコンテキストのReminderタイプは、通知を受け取る方法を説明します。

サービスを宣言するときの行( "Zabr-SMSSender-1.0")は、次の形式にすることができます。
「会社のプログラムバージョン」、なぜわからないのか、どうやら統計情報:)

txtLogin-ログイン、txtPasswd-パスワード、txtTopic-イベントテーマ、
txtMessage-イベントメッセージ、まあ、イベントの開始日と終了日。

Googleサーバーとクライアント間で時間が一致しない場合があるため、少し調整することができます( StartDate.AddMinutes(3)、EndDate.AddMinutes(5)

Source: https://habr.com/ru/post/J45252/


All Articles