-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
40 lines (39 loc) · 1.2 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Net;
using System.Windows.Forms;
namespace TwitterClient
{
static class Program
{
/// <summary>
/// アプリケーションのメイン エントリ ポイントです。
/// </summary>
[STAThread]
static int Main(string[] args)
{
ServicePointManager.SecurityProtocol = SecurityProtocolTypeExtensions.Tls11 | SecurityProtocolTypeExtensions.Tls12;
if (args.Length == 0) return 1;
if (args[0] == "--config")
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Config());
}
else
{
Twitter twitter = Twitter.Load(Properties.Settings.Default.SettingFilePath);
if (twitter == null) return 1;
try
{
twitter.PostTweet(args[0]);
}
catch (Exception)
{
return 1;
}
}
return 0;
}
}
}