リビジョン 73
branches/src/UpDateCopy/UpDateCopy/App.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8" ?> |
|
2 |
<configuration> |
|
3 |
<startup> |
|
4 |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> |
|
5 |
</startup> |
|
6 |
</configuration> |
branches/src/UpDateCopy/UpDateCopy/ClsCommon.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.IO; |
|
4 |
using System.Linq; |
|
5 |
using System.Security.Cryptography; |
|
6 |
using System.Text; |
|
7 |
using System.Threading.Tasks; |
|
8 |
|
|
9 |
namespace UpDateCopy |
|
10 |
{ |
|
11 |
public static class ClsCommon |
|
12 |
{ |
|
13 |
#region 定数 |
|
14 |
|
|
15 |
/// <summary> |
|
16 |
/// 監視対象プロセス名 |
|
17 |
/// </summary> |
|
18 |
public const string s_TargetProcess = "現場監督秘書"; |
|
19 |
/// <summary> |
|
20 |
/// パスを定数で定義する |
|
21 |
/// </summary> |
|
22 |
//public const string s_UPDATE_FILE_PATH = @"Z:\52GenbaKantokuHisyo"; |
|
23 |
//public const string s_UPDATE_FILE_PATH = @"Z:\5-2現場監督秘書"; |
|
24 |
//private const string s_UPDATE_FILE_PATH = @"Z:\⑤IT事業部用\Debug"; |
|
25 |
|
|
26 |
/// <summary> |
|
27 |
/// エラーログファイル |
|
28 |
/// </summary> |
|
29 |
public const string s_ErrorFileName = @".\log\Error.txt"; |
|
30 |
|
|
31 |
// ▼自動更新VPS対応▼ |
|
32 |
// FTPユーザ名 |
|
33 |
public const string s_FTP_USER_NAME = "pmaint"; |
|
34 |
// FTPパスワード |
|
35 |
public const string s_FTP_PASSWORD = "hyou5210"; |
|
36 |
// FTPつなぎ先パス |
|
37 |
public const string s_FTP_SERVER_PATH = "ftp://203.137.94.208:990/HYOU/"; |
|
38 |
// 本体モジュールフォルダ |
|
39 |
public const string s_HONTAI_MODULE = "ProcessManagement"; |
|
40 |
// UVERSIONキー名 |
|
41 |
public const string s_UVERSION_KEY = "uversion"; |
|
42 |
// MVERSIONキー名 |
|
43 |
public const string s_MVERSION_KEY = "mversion"; |
|
44 |
// VERSIONセクション名 |
|
45 |
public const string s_VERSION_SECTION = "genbaKantokuHisyo"; |
|
46 |
// 起動パラメータ |
|
47 |
public const string s_KIDOU_PARAM = "/NOCHECK"; |
|
48 |
// ▲自動更新VPS対応▲ |
|
49 |
#endregion |
|
50 |
|
|
51 |
/// <summary> |
|
52 |
/// エラー時ログファイル出力 |
|
53 |
/// </summary> |
|
54 |
/// <param name="message"></param> |
|
55 |
public static void ErrorLogWrite(string message) |
|
56 |
{ |
|
57 |
try |
|
58 |
{ |
|
59 |
// ディレクトリの確認 |
|
60 |
int spoint = ClsCommon.s_ErrorFileName.LastIndexOf("\\") + 1; |
|
61 |
string path = ClsCommon.s_ErrorFileName.Substring(spoint); |
|
62 |
if (Directory.Exists(@path)) |
|
63 |
Directory.CreateDirectory(@path); |
|
64 |
// ログ書込み |
|
65 |
StreamWriter writer = new StreamWriter(@ClsCommon.s_ErrorFileName, true, Encoding.GetEncoding("Shift_JIS")); |
|
66 |
writer.WriteLine("Error={0}:{1}", DateTime.Now.ToLongTimeString(), message); |
|
67 |
writer.Close(); |
|
68 |
} |
|
69 |
catch |
|
70 |
{ |
|
71 |
|
|
72 |
} |
|
73 |
} |
|
74 |
/// ファイルパスよりmd5のハッシュ値を返す |
|
75 |
/// </summary> |
|
76 |
/// <param name="FilePath"></param> |
|
77 |
/// <returns></returns> |
|
78 |
public static string GetFileHashData(string FilePath) |
|
79 |
{ |
|
80 |
try |
|
81 |
{ |
|
82 |
//ファイルを開く |
|
83 |
FileStream fs = new FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read); |
|
84 |
|
|
85 |
//MD5CryptoServiceProviderオブジェクトを作成 |
|
86 |
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); |
|
87 |
|
|
88 |
//ハッシュ値を計算する |
|
89 |
byte[] bs = md5.ComputeHash(fs); |
|
90 |
|
|
91 |
//リソースを解放する |
|
92 |
md5.Clear(); |
|
93 |
//ファイルを閉じる |
|
94 |
fs.Close(); |
|
95 |
|
|
96 |
return BitConverter.ToString(bs).ToLower().Replace("-", ""); |
|
97 |
|
|
98 |
} |
|
99 |
catch (Exception ex) |
|
100 |
{ |
|
101 |
ErrorLogWrite(ex.Message.ToString()); |
|
102 |
return string.Empty; |
|
103 |
} |
|
104 |
} |
|
105 |
/// <summary> |
|
106 |
/// ファイルの時間を取得する |
|
107 |
/// </summary> |
|
108 |
/// <param name="FilePath">ファイルパス</param> |
|
109 |
/// <param name="flg">取得日付フラグ</param> |
|
110 |
/// <returns></returns> |
|
111 |
public static DateTime GetFileTimeStamp(string FilePath, char flg) |
|
112 |
{ |
|
113 |
try |
|
114 |
{ |
|
115 |
DateTime dtDateTime = DateTime.MinValue; |
|
116 |
|
|
117 |
if (flg == 'C') |
|
118 |
{ |
|
119 |
// 作成日時を取得する |
|
120 |
dtDateTime = File.GetCreationTime(@FilePath); |
|
121 |
} |
|
122 |
else if (flg == 'U') |
|
123 |
{ |
|
124 |
// 更新日時を取得する |
|
125 |
dtDateTime = File.GetLastWriteTime(@FilePath); |
|
126 |
} |
|
127 |
else if (flg == 'A') |
|
128 |
{ |
|
129 |
// アクセス日時を取得する |
|
130 |
dtDateTime = File.GetLastAccessTime(@FilePath); |
|
131 |
} |
|
132 |
|
|
133 |
return dtDateTime; |
|
134 |
} |
|
135 |
catch (Exception ex) |
|
136 |
{ |
|
137 |
ErrorLogWrite(ex.Message.ToString()); |
|
138 |
return DateTime.Now; |
|
139 |
} |
|
140 |
} |
|
141 |
} |
|
142 |
} |
branches/src/UpDateCopy/UpDateCopy/FrmCopy.Designer.cs | ||
---|---|---|
1 |
namespace UpDateCopy |
|
2 |
{ |
|
3 |
partial class FrmCopy |
|
4 |
{ |
|
5 |
/// <summary> |
|
6 |
/// 必要なデザイナー変数です。 |
|
7 |
/// </summary> |
|
8 |
private System.ComponentModel.IContainer components = null; |
|
9 |
|
|
10 |
/// <summary> |
|
11 |
/// 使用中のリソースをすべてクリーンアップします。 |
|
12 |
/// </summary> |
|
13 |
/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param> |
|
14 |
protected override void Dispose(bool disposing) |
|
15 |
{ |
|
16 |
if (disposing && (components != null)) |
|
17 |
{ |
|
18 |
components.Dispose(); |
|
19 |
} |
|
20 |
base.Dispose(disposing); |
|
21 |
} |
|
22 |
|
|
23 |
#region Windows フォーム デザイナーで生成されたコード |
|
24 |
|
|
25 |
/// <summary> |
|
26 |
/// デザイナー サポートに必要なメソッドです。このメソッドの内容を |
|
27 |
/// コード エディターで変更しないでください。 |
|
28 |
/// </summary> |
|
29 |
private void InitializeComponent() |
|
30 |
{ |
|
31 |
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmCopy)); |
|
32 |
this.progressBar = new System.Windows.Forms.ProgressBar(); |
|
33 |
this.lblMessage = new System.Windows.Forms.Label(); |
|
34 |
this.SuspendLayout(); |
|
35 |
// |
|
36 |
// progressBar |
|
37 |
// |
|
38 |
this.progressBar.Location = new System.Drawing.Point(12, 209); |
|
39 |
this.progressBar.Name = "progressBar"; |
|
40 |
this.progressBar.Size = new System.Drawing.Size(610, 54); |
|
41 |
this.progressBar.TabIndex = 0; |
|
42 |
// |
|
43 |
// lblMessage |
|
44 |
// |
|
45 |
this.lblMessage.BackColor = System.Drawing.Color.White; |
|
46 |
this.lblMessage.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; |
|
47 |
this.lblMessage.Font = new System.Drawing.Font("MS 明朝", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); |
|
48 |
this.lblMessage.Location = new System.Drawing.Point(12, 27); |
|
49 |
this.lblMessage.Name = "lblMessage"; |
|
50 |
this.lblMessage.Size = new System.Drawing.Size(610, 169); |
|
51 |
this.lblMessage.TabIndex = 1; |
|
52 |
this.lblMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; |
|
53 |
// |
|
54 |
// FrmCopy |
|
55 |
// |
|
56 |
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); |
|
57 |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
|
58 |
this.ClientSize = new System.Drawing.Size(634, 275); |
|
59 |
this.Controls.Add(this.lblMessage); |
|
60 |
this.Controls.Add(this.progressBar); |
|
61 |
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); |
|
62 |
this.MaximizeBox = false; |
|
63 |
this.MinimizeBox = false; |
|
64 |
this.Name = "FrmCopy"; |
|
65 |
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; |
|
66 |
this.Text = "プログラム更新"; |
|
67 |
this.Load += new System.EventHandler(this.FrmCopy_Load); |
|
68 |
this.Shown += new System.EventHandler(this.FrmCopy_Shown); |
|
69 |
this.ResumeLayout(false); |
|
70 |
|
|
71 |
} |
|
72 |
|
|
73 |
#endregion |
|
74 |
|
|
75 |
private System.Windows.Forms.ProgressBar progressBar; |
|
76 |
private System.Windows.Forms.Label lblMessage; |
|
77 |
} |
|
78 |
} |
|
79 |
|
branches/src/UpDateCopy/UpDateCopy/FrmCopy.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections; |
|
3 |
using System.Collections.Generic; |
|
4 |
using System.ComponentModel; |
|
5 |
using System.Data; |
|
6 |
using System.Diagnostics; |
|
7 |
using System.Drawing; |
|
8 |
using System.IO; |
|
9 |
using System.Linq; |
|
10 |
using System.Security.Cryptography; |
|
11 |
using System.Text; |
|
12 |
using System.Threading.Tasks; |
|
13 |
using System.Windows.Forms; |
|
14 |
using System.IO.Compression; |
|
15 |
|
|
16 |
namespace UpDateCopy |
|
17 |
{ |
|
18 |
public partial class FrmCopy : Form |
|
19 |
{ |
|
20 |
|
|
21 |
// コピー一覧リスト |
|
22 |
private static List<string> m_CopyList = new List<string>(); |
|
23 |
|
|
24 |
#region コンストラクタ |
|
25 |
public FrmCopy() |
|
26 |
{ |
|
27 |
InitializeComponent(); |
|
28 |
} |
|
29 |
#endregion |
|
30 |
|
|
31 |
/// <summary> |
|
32 |
/// 画面ロード |
|
33 |
/// </summary> |
|
34 |
/// <param name="sender"></param> |
|
35 |
/// <param name="e"></param> |
|
36 |
private void FrmCopy_Load(object sender, EventArgs e) |
|
37 |
{ |
|
38 |
} |
|
39 |
|
|
40 |
/// <summary> |
|
41 |
/// 工程管理の終了を待ってコピーする |
|
42 |
/// </summary> |
|
43 |
/// <param name="sender"></param> |
|
44 |
/// <param name="e"></param> |
|
45 |
private void FrmCopy_Shown(object sender, EventArgs e) |
|
46 |
{ |
|
47 |
// コマンドライン引数を取る |
|
48 |
string[] cmds = Environment.GetCommandLineArgs(); |
|
49 |
|
|
50 |
lblMessage.Text = ClsCommon.s_TargetProcess + "を更新しています。\nそのまましばらくお待ちください。"; |
|
51 |
lblMessage.Refresh(); |
|
52 |
|
|
53 |
// ▼自動更新VPS対応▼ |
|
54 |
System.Threading.Thread.Sleep(1000); |
|
55 |
|
|
56 |
string tempPath = Path.GetTempPath(); |
|
57 |
// サーバ更新モジュールzipファイル(ダウンロード後) |
|
58 |
string updateModuleZip = tempPath + ClsCommon.s_HONTAI_MODULE + ".zip"; |
|
59 |
|
|
60 |
// 「現場監督秘書(本体)zipの展開フォルダが存在するかチェック |
|
61 |
if (System.IO.Directory.Exists(tempPath + ClsCommon.s_HONTAI_MODULE)) { |
|
62 |
// zip削除 |
|
63 |
System.IO.File.Delete(tempPath + ClsCommon.s_HONTAI_MODULE + ".zip"); |
|
64 |
// ダウンロードファイル削除 |
|
65 |
System.IO.Directory.Delete(tempPath + ClsCommon.s_HONTAI_MODULE, true); |
|
66 |
} |
|
67 |
// 「現場監督秘書(本体)zipダウンロード |
|
68 |
download(ClsCommon.s_FTP_SERVER_PATH + ClsCommon.s_HONTAI_MODULE + ".zip", updateModuleZip); |
|
69 |
// ダウンロードした「現場監督秘書(本体)zip解凍 |
|
70 |
ZipFile.ExtractToDirectory(updateModuleZip, tempPath); |
|
71 |
// ▲自動更新VPS対応▲ |
|
72 |
|
|
73 |
// メインプログラムの終了を待つ |
|
74 |
while (true) |
|
75 |
{ |
|
76 |
bool Aliveflg = false; |
|
77 |
int cnt = 0; |
|
78 |
Process[] processList = Process.GetProcesses(); |
|
79 |
foreach (Process p in processList) |
|
80 |
{ |
|
81 |
Aliveflg = false; |
|
82 |
if (p.ProcessName == ClsCommon.s_TargetProcess) |
|
83 |
{ |
|
84 |
if (p.Responding) |
|
85 |
{ |
|
86 |
Aliveflg = true; |
|
87 |
Console.WriteLine("OK"); |
|
88 |
break; |
|
89 |
} |
|
90 |
} |
|
91 |
Debug.WriteLine(++cnt + ":" + p.ProcessName); |
|
92 |
} |
|
93 |
if (!Aliveflg) break; |
|
94 |
System.Threading.Thread.Sleep(1000); |
|
95 |
} |
|
96 |
|
|
97 |
System.Threading.Thread.Sleep(1000); |
|
98 |
|
|
99 |
// ファイルコピー |
|
100 |
CopyFileProcess(); |
|
101 |
|
|
102 |
this.Close(); |
|
103 |
Application.Exit(); |
|
104 |
|
|
105 |
// ターゲットを起動する |
|
106 |
string ExecProc = System.Environment.CurrentDirectory + "\\" + ClsCommon.s_TargetProcess + ".exe"; |
|
107 |
//logger.ErrorFormat("{0}:起動プログラム:{1}", this.Name, ExecProc); |
|
108 |
// ▼自動更新VPS対応▼ |
|
109 |
// 起動パラメータつきで起動する |
|
110 |
Process exec = Process.Start(ExecProc, ClsCommon.s_KIDOU_PARAM); |
|
111 |
// Process exec = Process.Start(ExecProc); |
|
112 |
// ▲自動更新VPS対応▲ |
|
113 |
|
|
114 |
} |
|
115 |
|
|
116 |
/// <summary> |
|
117 |
/// ファイルコピーメイン |
|
118 |
/// </summary> |
|
119 |
/// <param name="dir"></param> |
|
120 |
private void CopyFileProcess() |
|
121 |
{ |
|
122 |
try |
|
123 |
{ |
|
124 |
// コピー対象を検索する |
|
125 |
CreateCopyList(); |
|
126 |
// コピー対象が無ければ処理終了 |
|
127 |
if (m_CopyList.Count == 0) return; |
|
128 |
|
|
129 |
lblMessage.Text = ClsCommon.s_TargetProcess + "を更新しています。\nそのまましばらくお待ちください。"; |
|
130 |
lblMessage.Refresh(); |
|
131 |
|
|
132 |
// プログレスバー設定 |
|
133 |
progressBar.Minimum = 0; |
|
134 |
progressBar.Value = 0; |
|
135 |
// プログレスバーMAX設定 |
|
136 |
progressBar.Maximum = m_CopyList.Count; |
|
137 |
|
|
138 |
// コピー先ファイル名 |
|
139 |
string destinationPath = System.Environment.CurrentDirectory + @"\" ; |
|
140 |
|
|
141 |
// ファイルコピー |
|
142 |
for (int i = 0; i < m_CopyList.Count; i++) |
|
143 |
{ |
|
144 |
// ファイル名を取得する |
|
145 |
int spoint = m_CopyList[i].LastIndexOf("\\") + 1; |
|
146 |
string Procename = m_CopyList[i].Substring(spoint); |
|
147 |
|
|
148 |
// コピー先ファイル名 |
|
149 |
string destinationFile = @destinationPath + Procename; |
|
150 |
|
|
151 |
// ファイルコピー |
|
152 |
File.Copy(@m_CopyList[i], @destinationFile, true); |
|
153 |
ClsCommon.ErrorLogWrite(string.Format("{0}::{1}", @m_CopyList[i], @destinationFile)); |
|
154 |
// プログレスバー加算 |
|
155 |
progressBar.Value++; |
|
156 |
progressBar.Refresh(); |
|
157 |
} |
|
158 |
// プログレスバー加算 |
|
159 |
progressBar.Value = progressBar.Maximum; |
|
160 |
progressBar.Refresh(); |
|
161 |
// ▼自動更新VPS対応▼ |
|
162 |
string tempPath = Path.GetTempPath(); |
|
163 |
// zip削除 |
|
164 |
System.IO.File.Delete(tempPath + ClsCommon.s_HONTAI_MODULE + ".zip"); |
|
165 |
// ダウンロードファイル削除 |
|
166 |
System.IO.Directory.Delete(tempPath + ClsCommon.s_HONTAI_MODULE, true); |
|
167 |
// ▲自動更新VPS対応▲ |
|
168 |
|
|
169 |
} |
|
170 |
catch (Exception ex) |
|
171 |
{ |
|
172 |
ClsCommon.ErrorLogWrite(ex.Message.ToString()); |
|
173 |
} |
|
174 |
} |
|
175 |
/// <summary> |
|
176 |
/// コピーファイル一覧作成 |
|
177 |
/// </summary> |
|
178 |
/// <param name="wrtString"></param> |
|
179 |
/// <returns></returns> |
|
180 |
private void CreateCopyList() |
|
181 |
{ |
|
182 |
|
|
183 |
try |
|
184 |
{ |
|
185 |
lblMessage.Text = ClsCommon.s_TargetProcess + "の更新を調査しています。\nそのまましばらくお待ちください。"; |
|
186 |
lblMessage.Refresh(); |
|
187 |
|
|
188 |
// 自プロセス名を作成する |
|
189 |
string myProcess = Process.GetCurrentProcess().ProcessName + ".exe"; |
|
190 |
|
|
191 |
// ▼自動更新VPS対応▼ |
|
192 |
// コピー元ファイル名を取得する |
|
193 |
// string[] files = Directory.GetFiles(@ClsCommon.s_UPDATE_FILE_PATH); |
|
194 |
string[] files = Directory.GetFiles(Path.GetTempPath() + "\\" + ClsCommon.s_HONTAI_MODULE); |
|
195 |
// ▲自動更新VPS対応▲ |
|
196 |
|
|
197 |
foreach (string sourceFile in files) |
|
198 |
{ |
|
199 |
// ファイル名を取得する |
|
200 |
int spoint = sourceFile.LastIndexOf("\\") + 1; |
|
201 |
string ProgramName = sourceFile.Substring(spoint); |
|
202 |
|
|
203 |
// 自分は処理しない |
|
204 |
if (myProcess == ProgramName) continue; |
|
205 |
|
|
206 |
// コピー先ファイル名 |
|
207 |
string destinationFile = System.Environment.CurrentDirectory + "\\" + ProgramName; |
|
208 |
|
|
209 |
// ----- コピー先にファイルファイルがない |
|
210 |
if (!File.Exists(@destinationFile)) |
|
211 |
{ |
|
212 |
m_CopyList.Add(@sourceFile); |
|
213 |
continue; |
|
214 |
} |
|
215 |
|
|
216 |
// ハッシュ値を取得する |
|
217 |
// ----- コピー元ファイル |
|
218 |
string srcHash = ClsCommon.GetFileHashData(@sourceFile); |
|
219 |
// ----- コピー先ファイル |
|
220 |
string destHash = ClsCommon.GetFileHashData(@destinationFile); |
|
221 |
|
|
222 |
// ファイルが違う |
|
223 |
if (srcHash != destHash) |
|
224 |
{ |
|
225 |
// 更新時間を確認する |
|
226 |
// ----- コピー元ファイル |
|
227 |
DateTime srcTimeStamp = ClsCommon.GetFileTimeStamp(@sourceFile, 'U'); |
|
228 |
// ----- コピー先ファイル |
|
229 |
DateTime destTimeStamp = ClsCommon.GetFileTimeStamp(@destinationFile, 'U'); |
|
230 |
// コピー元ファイルが新しくない |
|
231 |
if (srcTimeStamp <= destTimeStamp) continue; |
|
232 |
|
|
233 |
m_CopyList.Add(@sourceFile); |
|
234 |
} |
|
235 |
} |
|
236 |
} |
|
237 |
catch (Exception ex) |
|
238 |
{ |
|
239 |
ClsCommon.ErrorLogWrite(ex.Message.ToString()); |
|
240 |
} |
|
241 |
} |
|
242 |
|
|
243 |
// ▼自動更新VPS対応▼ |
|
244 |
// サーバからファイルダウンロード |
|
245 |
private static void download(String serverPath, String downloadSakiPath) |
|
246 |
{ |
|
247 |
//WebClientオブジェクトを作成 |
|
248 |
System.Net.WebClient wc = new System.Net.WebClient(); |
|
249 |
//ログインユーザー名とパスワードを指定 |
|
250 |
wc.Credentials = |
|
251 |
new System.Net.NetworkCredential(ClsCommon.s_FTP_USER_NAME, ClsCommon.s_FTP_PASSWORD); |
|
252 |
//FTPサーバーからダウンロードする |
|
253 |
wc.DownloadFile(serverPath, downloadSakiPath); |
|
254 |
//解放する |
|
255 |
wc.Dispose(); |
|
256 |
} |
|
257 |
// ▲自動更新VPS対応t▲ |
|
258 |
|
|
259 |
} |
|
260 |
} |
branches/src/UpDateCopy/UpDateCopy/FrmCopy.resx | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<root> |
|
3 |
<!-- |
|
4 |
Microsoft ResX Schema |
|
5 |
|
|
6 |
Version 2.0 |
|
7 |
|
|
8 |
The primary goals of this format is to allow a simple XML format |
|
9 |
that is mostly human readable. The generation and parsing of the |
|
10 |
various data types are done through the TypeConverter classes |
|
11 |
associated with the data types. |
|
12 |
|
|
13 |
Example: |
|
14 |
|
|
15 |
... ado.net/XML headers & schema ... |
|
16 |
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|
17 |
<resheader name="version">2.0</resheader> |
|
18 |
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|
19 |
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|
20 |
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|
21 |
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|
22 |
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
23 |
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|
24 |
</data> |
|
25 |
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
26 |
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|
27 |
<comment>This is a comment</comment> |
|
28 |
</data> |
|
29 |
|
|
30 |
There are any number of "resheader" rows that contain simple |
|
31 |
name/value pairs. |
|
32 |
|
|
33 |
Each data row contains a name, and value. The row also contains a |
|
34 |
type or mimetype. Type corresponds to a .NET class that support |
|
35 |
text/value conversion through the TypeConverter architecture. |
|
36 |
Classes that don't support this are serialized and stored with the |
|
37 |
mimetype set. |
|
38 |
|
|
39 |
The mimetype is used for serialized objects, and tells the |
|
40 |
ResXResourceReader how to depersist the object. This is currently not |
|
41 |
extensible. For a given mimetype the value must be set accordingly: |
|
42 |
|
|
43 |
Note - application/x-microsoft.net.object.binary.base64 is the format |
|
44 |
that the ResXResourceWriter will generate, however the reader can |
|
45 |
read any of the formats listed below. |
|
46 |
|
|
47 |
mimetype: application/x-microsoft.net.object.binary.base64 |
|
48 |
value : The object must be serialized with |
|
49 |
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
|
50 |
: and then encoded with base64 encoding. |
|
51 |
|
|
52 |
mimetype: application/x-microsoft.net.object.soap.base64 |
|
53 |
value : The object must be serialized with |
|
54 |
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|
55 |
: and then encoded with base64 encoding. |
|
56 |
|
|
57 |
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|
58 |
value : The object must be serialized into a byte array |
|
59 |
: using a System.ComponentModel.TypeConverter |
|
60 |
: and then encoded with base64 encoding. |
|
61 |
--> |
|
62 |
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|
63 |
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
|
64 |
<xsd:element name="root" msdata:IsDataSet="true"> |
|
65 |
<xsd:complexType> |
|
66 |
<xsd:choice maxOccurs="unbounded"> |
|
67 |
<xsd:element name="metadata"> |
|
68 |
<xsd:complexType> |
|
69 |
<xsd:sequence> |
|
70 |
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|
71 |
</xsd:sequence> |
|
72 |
<xsd:attribute name="name" use="required" type="xsd:string" /> |
|
73 |
<xsd:attribute name="type" type="xsd:string" /> |
|
74 |
<xsd:attribute name="mimetype" type="xsd:string" /> |
|
75 |
<xsd:attribute ref="xml:space" /> |
|
76 |
</xsd:complexType> |
|
77 |
</xsd:element> |
|
78 |
<xsd:element name="assembly"> |
|
79 |
<xsd:complexType> |
|
80 |
<xsd:attribute name="alias" type="xsd:string" /> |
|
81 |
<xsd:attribute name="name" type="xsd:string" /> |
|
82 |
</xsd:complexType> |
|
83 |
</xsd:element> |
|
84 |
<xsd:element name="data"> |
|
85 |
<xsd:complexType> |
|
86 |
<xsd:sequence> |
|
87 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
88 |
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|
89 |
</xsd:sequence> |
|
90 |
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
|
91 |
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|
92 |
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|
93 |
<xsd:attribute ref="xml:space" /> |
|
94 |
</xsd:complexType> |
|
95 |
</xsd:element> |
|
96 |
<xsd:element name="resheader"> |
|
97 |
<xsd:complexType> |
|
98 |
<xsd:sequence> |
|
99 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
100 |
</xsd:sequence> |
|
101 |
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|
102 |
</xsd:complexType> |
|
103 |
</xsd:element> |
|
104 |
</xsd:choice> |
|
105 |
</xsd:complexType> |
|
106 |
</xsd:element> |
|
107 |
</xsd:schema> |
|
108 |
<resheader name="resmimetype"> |
|
109 |
<value>text/microsoft-resx</value> |
|
110 |
</resheader> |
|
111 |
<resheader name="version"> |
|
112 |
<value>2.0</value> |
|
113 |
</resheader> |
|
114 |
<resheader name="reader"> |
|
115 |
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
116 |
</resheader> |
|
117 |
<resheader name="writer"> |
|
118 |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
119 |
</resheader> |
|
120 |
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> |
|
121 |
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
122 |
<value> |
|
123 |
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA |
|
124 |
AAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAQH/AAQC/wAAAP8AAAD/ARcL/wVLJP8Igz//C65T/w3I |
|
125 |
YP8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|
197 |
</root> |
branches/src/UpDateCopy/UpDateCopy/IniFile.cs | ||
---|---|---|
1 |
using System.Runtime.InteropServices; |
|
2 |
using System.Text; |
|
3 |
|
|
4 |
/// <summary> |
|
5 |
/// INIファイルを読み書きするクラス |
|
6 |
/// </summary> |
|
7 |
public class IniFile |
|
8 |
{ |
|
9 |
[DllImport("kernel32.dll")] |
|
10 |
private static extern int GetPrivateProfileString( |
|
11 |
string lpApplicationName, |
|
12 |
string lpKeyName, |
|
13 |
string lpDefault, |
|
14 |
StringBuilder lpReturnedstring, |
|
15 |
int nSize, |
|
16 |
string lpFileName); |
|
17 |
|
|
18 |
[DllImport("kernel32.dll")] |
|
19 |
private static extern int WritePrivateProfileString( |
|
20 |
string lpApplicationName, |
|
21 |
string lpKeyName, |
|
22 |
string lpstring, |
|
23 |
string lpFileName); |
|
24 |
|
|
25 |
string filePath; |
|
26 |
|
|
27 |
/// <summary> |
|
28 |
/// ファイル名を指定して初期化します。 |
|
29 |
/// ファイルが存在しない場合は初回書き込み時に作成されます。 |
|
30 |
/// </summary> |
|
31 |
public IniFile(string filePath) |
|
32 |
{ |
|
33 |
this.filePath = filePath; |
|
34 |
} |
|
35 |
|
|
36 |
/// <summary> |
|
37 |
/// sectionとkeyからiniファイルの設定値を取得、設定します。 |
|
38 |
/// </summary> |
|
39 |
/// <returns>指定したsectionとkeyの組合せが無い場合は""が返ります。</returns> |
|
40 |
public string this[string section, string key] |
|
41 |
{ |
|
42 |
set |
|
43 |
{ |
|
44 |
WritePrivateProfileString(section, key, value, filePath); |
|
45 |
} |
|
46 |
get |
|
47 |
{ |
|
48 |
StringBuilder sb = new StringBuilder(256); |
|
49 |
GetPrivateProfileString(section, key, string.Empty, sb, sb.Capacity, filePath); |
|
50 |
return sb.ToString(); |
|
51 |
} |
|
52 |
} |
|
53 |
|
|
54 |
/// <summary> |
|
55 |
/// sectionとkeyからiniファイルの設定値を取得します。 |
|
56 |
/// 指定したsectionとkeyの組合せが無い場合はdefaultvalueで指定した値が返ります。 |
|
57 |
/// </summary> |
|
58 |
/// <returns> |
|
59 |
/// 指定したsectionとkeyの組合せが無い場合はdefaultvalueで指定した値が返ります。 |
|
60 |
/// </returns> |
|
61 |
public string GetValue(string section, string key, string defaultvalue) |
|
62 |
{ |
|
63 |
StringBuilder sb = new StringBuilder(256); |
|
64 |
GetPrivateProfileString(section, key, defaultvalue, sb, sb.Capacity, filePath); |
|
65 |
return sb.ToString(); |
|
66 |
} |
|
67 |
} |
|
68 |
|
branches/src/UpDateCopy/UpDateCopy/Program.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Diagnostics; |
|
4 |
using System.IO; |
|
5 |
using System.Linq; |
|
6 |
using System.Threading.Tasks; |
|
7 |
using System.Windows.Forms; |
|
8 |
|
|
9 |
namespace UpDateCopy |
|
10 |
{ |
|
11 |
static class Program |
|
12 |
{ |
|
13 |
/// <summary> |
|
14 |
/// アプリケーションのメイン エントリ ポイントです。 |
|
15 |
/// </summary> |
|
16 |
[STAThread] |
|
17 |
static void Main() |
|
18 |
{ |
|
19 |
//すでに起動していると判断する |
|
20 |
if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length > 1) return; |
|
21 |
|
|
22 |
Application.EnableVisualStyles(); |
|
23 |
Application.SetCompatibleTextRenderingDefault(false); |
|
24 |
Application.Run(new FrmCopy()); |
|
25 |
} |
|
26 |
} |
|
27 |
} |
branches/src/UpDateCopy/UpDateCopy/Properties/AssemblyInfo.cs | ||
---|---|---|
1 |
using System.Reflection; |
|
2 |
using System.Runtime.CompilerServices; |
|
3 |
using System.Runtime.InteropServices; |
|
4 |
|
|
5 |
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 |
|
6 |
// アセンブリに関連付けられている情報を変更するには、 |
|
7 |
// これらの属性値を変更してください。 |
|
8 |
[assembly: AssemblyTitle("UpDateCopy")] |
|
9 |
[assembly: AssemblyDescription("")] |
|
10 |
[assembly: AssemblyConfiguration("")] |
|
11 |
[assembly: AssemblyCompany("")] |
|
12 |
[assembly: AssemblyProduct("UpDateCopy")] |
|
13 |
[assembly: AssemblyCopyright("H-YOU Systems Copyright © 2015-2017")] |
|
14 |
[assembly: AssemblyTrademark("")] |
|
15 |
[assembly: AssemblyCulture("")] |
|
16 |
|
|
17 |
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから |
|
18 |
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 |
|
19 |
// その型の ComVisible 属性を true に設定してください。 |
|
20 |
[assembly: ComVisible(false)] |
|
21 |
|
|
22 |
// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です |
|
23 |
[assembly: Guid("d1a52b1e-09ee-4ffd-bcca-9c613ddae486")] |
|
24 |
|
|
25 |
// アセンブリのバージョン情報は、以下の 4 つの値で構成されています: |
|
26 |
// |
|
27 |
// Major Version |
|
28 |
// Minor Version |
|
29 |
// Build Number |
|
30 |
// Revision |
|
31 |
// |
|
32 |
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を |
|
33 |
// 既定値にすることができます: |
|
34 |
// [assembly: AssemblyVersion("1.0.*")] |
|
35 |
[assembly: AssemblyVersion("1.0.0.0")] |
|
36 |
[assembly: AssemblyFileVersion("1.0.0.0")] |
branches/src/UpDateCopy/UpDateCopy/Properties/Resources.Designer.cs | ||
---|---|---|
1 |
//------------------------------------------------------------------------------ |
|
2 |
// <auto-generated> |
|
3 |
// このコードはツールによって生成されました。 |
|
4 |
// ランタイム バージョン:4.0.30319.42000 |
|
5 |
// |
|
6 |
// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 |
|
7 |
// コードが再生成されるときに損失したりします |
|
8 |
// </auto-generated> |
|
9 |
//------------------------------------------------------------------------------ |
|
10 |
|
|
11 |
namespace UpDateCopy.Properties |
|
12 |
{ |
|
13 |
|
|
14 |
|
|
15 |
/// <summary> |
|
16 |
/// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。 |
|
17 |
/// </summary> |
|
18 |
// このクラスは StronglyTypedResourceBuilder クラスが ResGen |
|
19 |
// または Visual Studio のようなツールを使用して自動生成されました。 |
|
20 |
// メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に |
|
21 |
// ResGen を実行し直すか、または VS プロジェクトをリビルドします。 |
|
22 |
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] |
|
23 |
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
|
24 |
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
|
25 |
internal class Resources |
|
26 |
{ |
|
27 |
|
|
28 |
private static global::System.Resources.ResourceManager resourceMan; |
|
29 |
|
|
30 |
private static global::System.Globalization.CultureInfo resourceCulture; |
|
31 |
|
|
32 |
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] |
|
33 |
internal Resources() |
|
34 |
{ |
|
35 |
} |
|
36 |
|
|
37 |
/// <summary> |
|
38 |
/// このクラスに使用される、キャッシュされた ResourceManager のインスタンスを返します。 |
|
39 |
/// </summary> |
|
40 |
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] |
|
41 |
internal static global::System.Resources.ResourceManager ResourceManager |
|
42 |
{ |
|
43 |
get |
|
44 |
{ |
|
45 |
if ((resourceMan == null)) |
|
46 |
{ |
|
47 |
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UpDateCopy.Properties.Resources", typeof(Resources).Assembly); |
|
48 |
resourceMan = temp; |
|
49 |
} |
|
50 |
return resourceMan; |
|
51 |
} |
|
52 |
} |
|
53 |
|
|
54 |
/// <summary> |
|
55 |
/// 厳密に型指定されたこのリソース クラスを使用して、すべての検索リソースに対し、 |
|
56 |
/// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。 |
|
57 |
/// </summary> |
|
58 |
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] |
|
59 |
internal static global::System.Globalization.CultureInfo Culture |
|
60 |
{ |
|
61 |
get |
|
62 |
{ |
|
63 |
return resourceCulture; |
|
64 |
} |
|
65 |
set |
|
66 |
{ |
|
67 |
resourceCulture = value; |
|
68 |
} |
|
69 |
} |
|
70 |
} |
|
71 |
} |
branches/src/UpDateCopy/UpDateCopy/Properties/Resources.resx | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<root> |
|
3 |
<!-- |
|
4 |
Microsoft ResX Schema |
|
5 |
|
|
6 |
Version 2.0 |
|
7 |
|
|
8 |
The primary goals of this format is to allow a simple XML format |
|
9 |
that is mostly human readable. The generation and parsing of the |
|
10 |
various data types are done through the TypeConverter classes |
|
11 |
associated with the data types. |
|
12 |
|
|
13 |
Example: |
|
14 |
|
|
15 |
... ado.net/XML headers & schema ... |
|
16 |
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|
17 |
<resheader name="version">2.0</resheader> |
|
18 |
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|
19 |
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|
20 |
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|
21 |
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|
22 |
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
23 |
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|
24 |
</data> |
|
25 |
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
26 |
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|
27 |
<comment>This is a comment</comment> |
|
28 |
</data> |
|
29 |
|
|
30 |
There are any number of "resheader" rows that contain simple |
|
31 |
name/value pairs. |
|
32 |
|
|
33 |
Each data row contains a name, and value. The row also contains a |
|
34 |
type or mimetype. Type corresponds to a .NET class that support |
|
35 |
text/value conversion through the TypeConverter architecture. |
|
36 |
Classes that don't support this are serialized and stored with the |
|
37 |
mimetype set. |
|
38 |
|
|
39 |
The mimetype is used for serialized objects, and tells the |
|
40 |
ResXResourceReader how to depersist the object. This is currently not |
|
41 |
extensible. For a given mimetype the value must be set accordingly: |
|
42 |
|
|
43 |
Note - application/x-microsoft.net.object.binary.base64 is the format |
|
44 |
that the ResXResourceWriter will generate, however the reader can |
|
45 |
read any of the formats listed below. |
|
46 |
|
|
47 |
mimetype: application/x-microsoft.net.object.binary.base64 |
|
48 |
value : The object must be serialized with |
|
49 |
: System.Serialization.Formatters.Binary.BinaryFormatter |
|
50 |
: and then encoded with base64 encoding. |
|
51 |
|
|
52 |
mimetype: application/x-microsoft.net.object.soap.base64 |
|
53 |
value : The object must be serialized with |
|
54 |
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|
55 |
: and then encoded with base64 encoding. |
|
56 |
|
|
57 |
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|
58 |
value : The object must be serialized into a byte array |
|
59 |
: using a System.ComponentModel.TypeConverter |
|
60 |
: and then encoded with base64 encoding. |
|
61 |
--> |
|
62 |
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|
63 |
<xsd:element name="root" msdata:IsDataSet="true"> |
|
64 |
<xsd:complexType> |
|
65 |
<xsd:choice maxOccurs="unbounded"> |
|
66 |
<xsd:element name="metadata"> |
|
67 |
<xsd:complexType> |
|
68 |
<xsd:sequence> |
|
69 |
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|
70 |
</xsd:sequence> |
|
71 |
<xsd:attribute name="name" type="xsd:string" /> |
|
72 |
<xsd:attribute name="type" type="xsd:string" /> |
|
73 |
<xsd:attribute name="mimetype" type="xsd:string" /> |
|
74 |
</xsd:complexType> |
|
75 |
</xsd:element> |
|
76 |
<xsd:element name="assembly"> |
|
77 |
<xsd:complexType> |
|
78 |
<xsd:attribute name="alias" type="xsd:string" /> |
|
79 |
<xsd:attribute name="name" type="xsd:string" /> |
|
80 |
</xsd:complexType> |
|
81 |
</xsd:element> |
|
82 |
<xsd:element name="data"> |
|
83 |
<xsd:complexType> |
|
84 |
<xsd:sequence> |
|
85 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
86 |
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|
87 |
</xsd:sequence> |
|
88 |
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> |
|
89 |
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|
90 |
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|
91 |
</xsd:complexType> |
|
92 |
</xsd:element> |
|
93 |
<xsd:element name="resheader"> |
|
94 |
<xsd:complexType> |
|
95 |
<xsd:sequence> |
|
96 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
97 |
</xsd:sequence> |
|
98 |
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|
99 |
</xsd:complexType> |
|
100 |
</xsd:element> |
|
101 |
</xsd:choice> |
|
102 |
</xsd:complexType> |
|
103 |
</xsd:element> |
|
104 |
</xsd:schema> |
|
105 |
<resheader name="resmimetype"> |
|
106 |
<value>text/microsoft-resx</value> |
|
107 |
</resheader> |
|
108 |
<resheader name="version"> |
|
109 |
<value>2.0</value> |
|
110 |
</resheader> |
|
111 |
<resheader name="reader"> |
|
112 |
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
113 |
</resheader> |
|
114 |
<resheader name="writer"> |
|
115 |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
116 |
</resheader> |
|
117 |
</root> |
branches/src/UpDateCopy/UpDateCopy/Properties/Settings.Designer.cs | ||
---|---|---|
1 |
//------------------------------------------------------------------------------ |
|
2 |
// <auto-generated> |
|
3 |
// This code was generated by a tool. |
|
4 |
// Runtime Version:4.0.30319.42000 |
|
5 |
// |
|
6 |
// Changes to this file may cause incorrect behavior and will be lost if |
|
7 |
// the code is regenerated. |
|
8 |
// </auto-generated> |
|
9 |
//------------------------------------------------------------------------------ |
|
10 |
|
|
11 |
namespace UpDateCopy.Properties |
|
12 |
{ |
|
13 |
|
|
14 |
|
|
15 |
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
|
16 |
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] |
|
17 |
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase |
|
18 |
{ |
|
19 |
|
|
20 |
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); |
|
21 |
|
|
22 |
public static Settings Default |
|
23 |
{ |
|
24 |
get |
|
25 |
{ |
|
26 |
return defaultInstance; |
|
27 |
} |
|
28 |
} |
|
29 |
} |
|
30 |
} |
branches/src/UpDateCopy/UpDateCopy/Properties/Settings.settings | ||
---|---|---|
1 |
<?xml version='1.0' encoding='utf-8'?> |
|
2 |
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> |
|
3 |
<Profiles> |
|
4 |
<Profile Name="(Default)" /> |
|
5 |
</Profiles> |
|
6 |
<Settings /> |
|
7 |
</SettingsFile> |
branches/src/UpDateCopy/UpDateCopy/UpDateCopy.csproj | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
3 |
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|
4 |
<PropertyGroup> |
|
5 |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|
6 |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|
7 |
<ProjectGuid>{3B7CCC3E-82E5-42CA-8EE1-7628D4B52820}</ProjectGuid> |
|
8 |
<OutputType>WinExe</OutputType> |
|
9 |
<AppDesignerFolder>Properties</AppDesignerFolder> |
|
10 |
<RootNamespace>UpDateCopy</RootNamespace> |
|
11 |
<AssemblyName>UpDateCopy</AssemblyName> |
|
12 |
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
|
13 |
<FileAlignment>512</FileAlignment> |
|
14 |
</PropertyGroup> |
|
15 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
16 |
<PlatformTarget>AnyCPU</PlatformTarget> |
|
17 |
<DebugSymbols>true</DebugSymbols> |
|
18 |
<DebugType>full</DebugType> |
|
19 |
<Optimize>false</Optimize> |
|
20 |
<OutputPath>bin\Debug\</OutputPath> |
|
21 |
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
22 |
<ErrorReport>prompt</ErrorReport> |
|
23 |
<WarningLevel>4</WarningLevel> |
|
24 |
</PropertyGroup> |
|
25 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
26 |
<PlatformTarget>AnyCPU</PlatformTarget> |
|
27 |
<DebugType>pdbonly</DebugType> |
|
28 |
<Optimize>true</Optimize> |
|
29 |
<OutputPath>bin\Release\</OutputPath> |
|
30 |
<DefineConstants>TRACE</DefineConstants> |
|
31 |
<ErrorReport>prompt</ErrorReport> |
|
32 |
<WarningLevel>4</WarningLevel> |
|
33 |
</PropertyGroup> |
|
34 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> |
|
35 |
<DebugSymbols>true</DebugSymbols> |
|
36 |
<OutputPath>bin\x86\Debug\</OutputPath> |
|
37 |
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
38 |
<DebugType>full</DebugType> |
|
39 |
<PlatformTarget>x86</PlatformTarget> |
|
40 |
<ErrorReport>prompt</ErrorReport> |
|
41 |
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> |
|
42 |
<Prefer32Bit>true</Prefer32Bit> |
|
43 |
</PropertyGroup> |
|
44 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> |
|
45 |
<OutputPath>bin\x86\Release\</OutputPath> |
|
46 |
<DefineConstants>TRACE</DefineConstants> |
|
47 |
<Optimize>true</Optimize> |
|
48 |
<DebugType>pdbonly</DebugType> |
|
49 |
<PlatformTarget>x86</PlatformTarget> |
|
50 |
<ErrorReport>prompt</ErrorReport> |
|
51 |
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> |
|
52 |
<Prefer32Bit>true</Prefer32Bit> |
|
53 |
</PropertyGroup> |
|
54 |
<PropertyGroup> |
|
55 |
<ApplicationIcon>updatIcon.ico</ApplicationIcon> |
|
56 |
</PropertyGroup> |
|
57 |
<ItemGroup> |
|
58 |
<Reference Include="System" /> |
|
59 |
<Reference Include="System.Core" /> |
|
60 |
<Reference Include="System.IO.Compression" /> |
|
61 |
<Reference Include="System.IO.Compression.FileSystem" /> |
|
62 |
<Reference Include="System.Xml.Linq" /> |
|
63 |
<Reference Include="System.Data.DataSetExtensions" /> |
|
64 |
<Reference Include="Microsoft.CSharp" /> |
|
65 |
<Reference Include="System.Data" /> |
|
66 |
<Reference Include="System.Deployment" /> |
|
67 |
<Reference Include="System.Drawing" /> |
|
68 |
<Reference Include="System.Windows.Forms" /> |
|
69 |
<Reference Include="System.Xml" /> |
|
70 |
</ItemGroup> |
|
71 |
<ItemGroup> |
|
72 |
<Compile Include="ClsCommon.cs" /> |
|
73 |
<Compile Include="FrmCopy.cs"> |
|
74 |
<SubType>Form</SubType> |
|
75 |
</Compile> |
|
76 |
<Compile Include="FrmCopy.Designer.cs"> |
|
77 |
<DependentUpon>FrmCopy.cs</DependentUpon> |
|
78 |
</Compile> |
|
79 |
<Compile Include="IniFile.cs" /> |
|
80 |
<Compile Include="Program.cs" /> |
|
81 |
<Compile Include="Properties\AssemblyInfo.cs" /> |
|
82 |
<EmbeddedResource Include="FrmCopy.resx"> |
|
83 |
<DependentUpon>FrmCopy.cs</DependentUpon> |
|
84 |
</EmbeddedResource> |
|
85 |
<EmbeddedResource Include="Properties\Resources.resx"> |
|
86 |
<Generator>ResXFileCodeGenerator</Generator> |
|
87 |
<LastGenOutput>Resources.Designer.cs</LastGenOutput> |
|
88 |
<SubType>Designer</SubType> |
|
89 |
</EmbeddedResource> |
|
90 |
<Compile Include="Properties\Resources.Designer.cs"> |
|
91 |
<AutoGen>True</AutoGen> |
|
92 |
<DependentUpon>Resources.resx</DependentUpon> |
|
93 |
</Compile> |
|
94 |
<None Include="Properties\Settings.settings"> |
|
95 |
<Generator>SettingsSingleFileGenerator</Generator> |
|
96 |
<LastGenOutput>Settings.Designer.cs</LastGenOutput> |
|
97 |
</None> |
|
98 |
<Compile Include="Properties\Settings.Designer.cs"> |
|
99 |
<AutoGen>True</AutoGen> |
|
100 |
<DependentUpon>Settings.settings</DependentUpon> |
|
101 |
<DesignTimeSharedInput>True</DesignTimeSharedInput> |
|
102 |
</Compile> |
|
103 |
</ItemGroup> |
|
104 |
<ItemGroup> |
|
105 |
<None Include="App.config" /> |
|
106 |
</ItemGroup> |
|
107 |
<ItemGroup> |
|
108 |
<Content Include="updatIcon.ico" /> |
|
109 |
</ItemGroup> |
|
110 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|
111 |
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
|
112 |
Other similar extension points exist, see Microsoft.Common.targets. |
|
113 |
<Target Name="BeforeBuild"> |
|
114 |
</Target> |
|
115 |
<Target Name="AfterBuild"> |
|
116 |
</Target> |
|
117 |
--> |
|
118 |
</Project> |
branches/src/UpDateCopy/UpDateCopy/bin/Debug/ProcessManagement.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8" ?> |
|
2 |
<ProcessManagement> |
|
3 |
<!-- DB接続情報 --> |
|
4 |
<DBConnect> |
|
5 |
<DBUser>pmana</DBUser> |
|
6 |
<Password>manager</Password> |
|
7 |
<!--<DBDataSource>HyouServer</DBDataSource>--> |
|
8 |
<DBDataSource>XE</DBDataSource> |
|
9 |
</DBConnect> |
|
10 |
</ProcessManagement> |
branches/src/UpDateCopy/UpDateCopy/bin/Debug/UpDateCopy.exe.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8" ?> |
|
2 |
<configuration> |
|
3 |
<startup> |
|
4 |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> |
|
5 |
</startup> |
|
6 |
</configuration> |
branches/src/UpDateCopy/UpDateCopy/bin/Debug/UpDateCopy.vshost.exe.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8" ?> |
|
2 |
<configuration> |
|
3 |
<startup> |
|
4 |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> |
|
5 |
</startup> |
|
6 |
</configuration> |
branches/src/UpDateCopy/UpDateCopy/bin/Debug/UpDateCopy.vshost.exe.manifest | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
|
2 |
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> |
|
3 |
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> |
|
4 |
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> |
|
5 |
<security> |
|
6 |
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> |
|
7 |
<requestedExecutionLevel level="asInvoker" uiAccess="false"/> |
|
8 |
</requestedPrivileges> |
|
9 |
</security> |
|
10 |
</trustInfo> |
|
11 |
</assembly> |
branches/src/UpDateCopy/UpDateCopy/bin/Debug/log4net.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8" ?> |
|
2 |
<Structure> |
|
3 |
<log4net> |
|
4 |
|
|
5 |
<!-- 通常ログ:単一ファイル出力 --> |
|
6 |
<appender name="InfoLogDailyAppender" type="log4net.Appender.FileAppender"> |
|
7 |
<File value=".\\logs\\Info.log" /> |
|
8 |
|
|
9 |
<AppendToFile value="true" /> |
|
10 |
|
|
11 |
<filter type="log4net.Filter.LevelRangeFilter"> |
|
12 |
<param name="LevelMax" value="WARN" /> |
|
13 |
<param name="LevelMin" value="INFO" /> |
|
14 |
</filter> |
|
15 |
|
|
16 |
<layout type="log4net.Layout.PatternLayout"> |
|
17 |
<ConversionPattern value="%date [%thread] [%-5level] %logger - %message%n" /> |
|
18 |
</layout> |
|
19 |
</appender> |
|
20 |
|
|
21 |
<!-- エラーログ:分割ファイル出力 --> |
|
22 |
<appender name="ErrorLogDailyAppender" type="log4net.Appender.RollingFileAppender"> |
|
23 |
<!-- ファイル名は日付ごと --> |
|
24 |
<!--<param name="File" value=".\\logs\\Error_" />--> |
|
25 |
<!--<param name="DatePattern" value='yyyyMMdd".log"' /> |
|
26 |
<param name="RollingStyle" value="date" /> |
|
27 |
<param name="StaticLogFileName" value="false" />--> |
|
28 |
<!-- ファイル名を変える --> |
|
29 |
<File value=".\\logs\\Error.log" /> |
|
30 |
|
|
31 |
<param name="AppendToFile" value="true" /> |
|
32 |
|
|
33 |
<filter type="log4net.Filter.LevelRangeFilter"> |
|
34 |
<param name="LevelMax" value="FATAL" /> |
|
35 |
<param name="LevelMin" value="ERROR" /> |
|
36 |
</filter> |
|
37 |
|
|
38 |
<param name="MaximumFileSize" value="10MB" /> |
|
39 |
<param name="MaxSizeRollBackups" value="10" /> |
|
40 |
|
|
41 |
<layout type="log4net.Layout.PatternLayout"> |
|
42 |
<ConversionPattern value="%date [%thread] [%-5level] %logger - %message%n" /> |
|
43 |
</layout> |
|
44 |
</appender> |
|
45 |
|
|
46 |
<!-- デバッグ用:分割ファイル出力 --> |
|
47 |
<appender name="DebugLogDailyAppender" type="log4net.Appender.RollingFileAppender"> |
|
48 |
|
|
49 |
<!-- ファイル名は日付ごと --> |
|
50 |
<param name="File" value=".\\logs\\Trace_" /> |
|
51 |
<param name="DatePattern" value='yyyyMMdd".log"' /> |
|
52 |
<param name="RollingStyle" value="date" /> |
|
53 |
<param name="StaticLogFileName" value="false" /> |
|
54 |
|
|
55 |
<param name="AppendToFile" value="true" /> |
|
56 |
|
|
57 |
<filter type="log4net.Filter.LevelRangeFilter"> |
|
58 |
<!-- <param name="LevelMax" value="FATAL" /> --> |
|
59 |
<param name="LevelMin" value="TRACE" /> |
|
60 |
</filter> |
|
61 |
|
|
62 |
<param name="MaximumFileSize" value="10MB" /> |
|
63 |
<param name="MaxSizeRollBackups" value="10" /> |
|
64 |
|
|
65 |
<layout type="log4net.Layout.PatternLayout"> |
|
66 |
<ConversionPattern value="%date [%thread] [%-5level] %logger %file(%line) %class %method - %message%n" /> |
|
67 |
</layout> |
|
68 |
</appender> |
|
69 |
|
|
70 |
<root> |
|
71 |
<!-- TRACE以上のログを記録 --> |
|
72 |
<!--<level value="TRACE" />--> |
|
73 |
<level value="ERROR" /> |
|
74 |
<!-- 使用する Appender --> |
|
75 |
<!--<appender-ref ref="InfoLogDailyAppender" />--> |
|
76 |
<!--<appender-ref ref="DebugLogDailyAppender" />--> |
|
77 |
<appender-ref ref="ErrorLogDailyAppender" /> |
|
78 |
</root> |
|
79 |
|
|
80 |
</log4net> |
|
81 |
</Structure> |
branches/src/UpDateCopy/UpDateCopy/bin/Debug/log4net.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<doc> |
|
3 |
<assembly> |
|
4 |
<name>log4net</name> |
|
5 |
</assembly> |
|
6 |
<members> |
|
7 |
<member name="T:log4net.Appender.AdoNetAppender"> |
|
8 |
<summary> |
|
9 |
Appender that logs to a database. |
|
10 |
</summary> |
|
11 |
<remarks> |
|
12 |
<para> |
|
13 |
<see cref="T:log4net.Appender.AdoNetAppender"/> appends logging events to a table within a |
|
14 |
database. The appender can be configured to specify the connection |
|
15 |
string by setting the <see cref="P:log4net.Appender.AdoNetAppender.ConnectionString"/> property. |
|
16 |
The connection type (provider) can be specified by setting the <see cref="P:log4net.Appender.AdoNetAppender.ConnectionType"/> |
|
17 |
property. For more information on database connection strings for |
|
18 |
your specific database see <a href="http://www.connectionstrings.com/">http://www.connectionstrings.com/</a>. |
|
19 |
</para> |
|
20 |
<para> |
|
21 |
Records are written into the database either using a prepared |
|
22 |
statement or a stored procedure. The <see cref="P:log4net.Appender.AdoNetAppender.CommandType"/> property |
他の形式にエクスポート: Unified diff