-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
36 lines (32 loc) · 1.07 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
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;
namespace Console
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
string path = Application.StartupPath + "\\";
string dllFileName = "Newtonsoft.Json.dll";
//******加载Newtonsoft.Json.dll******
if (!File.Exists(path + dllFileName)) //文件不存在
{
FileStream fs = new FileStream(path + dllFileName, FileMode.CreateNew, FileAccess.Write);
byte[] buffer = Properties.Resources.Newtonsoft_Json;//{GetData是命名空间}
fs.Write(buffer, 0, buffer.Length);
fs.Close();
}
//*****************************
Application.Run(new mainForm(args));
}
}
}