このサイトは別な国語を表示されています。下手な翻訳に申し訳ないです。もし手伝いたいなら、私に連絡してください。

- 何か
- 2008年 2月 19日 火曜日 06:13:01 MDT
- このURL: http://ja.pastebin.ca/909715
- 代替物: プレーンテキスト
- 言語: C# ソース
- 齢: 4ヶ月6日17時間55分と18秒
- class AutoExtracter {
- BackgroundWorker backgroundWorker1;
- Process notePad;
- string Directory = "";
- System.Windows.Forms.RichTextBox output;
- // This delegate enables asynchronous calls for setting
- // the text property on a TextBox control.
- delegate void SetTextCallback(string text);
- public AutoExtracter() {
- this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
- this.backgroundWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted);
- }
- void dostuff() {
- if(dirs != null) {
- Directory = dirs[counter++];
- this.output = "";
- backgroundWorker1.RunWorkerAsync();
- }
- }
- private void SetText(string text) {
- // InvokeRequired required compares the thread ID of the
- // calling thread to the thread ID of the creating thread.
- // If these threads are different, it returns true.
- if(this.output.InvokeRequired) {
- } else {
- this.output.Text += text + "\r\n";
- }
- }
- void notePad_OutputDataReceived(object sender, DataReceivedEventArgs e) {
- this.SetText(e.Data);
- }
- private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) {
- if(!String.IsNullOrEmpty(Directory)) {
- notePad.StartInfo.FileName = @"filenamehere";
- notePad.StartInfo.Arguments = "vt \""+Directory+"\"";
- notePad.StartInfo.CreateNoWindow = true;
- notePad.StartInfo.RedirectStandardOutput = true;
- notePad.StartInfo.UseShellExecute = false;
- notePad.Start();
- notePad.BeginOutputReadLine();
- notePad.WaitForExit();
- }
- }
- private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) {
- string[] d = obj.Match(output).Groups[1].Value.Split('\n');
- for(int i = 0; i<d.Length; i+=3) {
- if(!obj2.Match(d[i]).Groups[1].Value.Trim().Contains("Data header type:")) {
- ls.Add(di);
- }
- }
- }
- }
合計ペーストビュー回数: 1 — トラックバック (0) — パーマリンク — ペーストを削除
ポストを更新
このポストは更新できる、または、新しいポストを作成。
You may also comment on this post.
Please note that information posted here will not expire by default. If you want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.