-3
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
namespace Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
using (FolderBrowserDialog fbd = new FolderBrowserDialog() { Description = "Select your path" })
{
if (fbd.ShowDialog() == DialogResult.OK)
tbxFrom.Text = fbd.SelectedPath;
}
}
private void button2_Click(object sender, EventArgs e)
{
var myLyndaFiles = Directory.GetFiles(tbxFrom.Text, ".lynda");
var lynda = Directory.GetFiles(tbxProgrammLocation.Text, ".exe");
for (int i = 0; i < myLyndaFiles.Length; i++)
{
Process.Start(@"C:\WINDOWS\system32\cmd.exe", lynda[0] + " /F " + myLyndaFiles[i] + " " + tbxTo.Text + "\n");
tbxOut.Text = i.ToString();
}
}
private void button3_Click(object sender, EventArgs e)
{
using (FolderBrowserDialog fbd = new FolderBrowserDialog() { Description = "Select your path" })
{
if (fbd.ShowDialog() == DialogResult.OK)
tbxTo.Text = fbd.SelectedPath;
}
}
private void btnStartFrom_Click(object sender, EventArgs e)
{
using (FolderBrowserDialog fbd = new FolderBrowserDialog() { Description = "Select your path" })
{
if (fbd.ShowDialog() == DialogResult.OK)
tbxProgrammLocation.Text = fbd.SelectedPath;
}
}
}
}
私を助けてください!理由は分かりませんが、Directory.GetFiles
のように動作しません。私はブレークポイント経由でvar myLyndaFiles
を調べましたが、それは多かれ少なかれ[0] - >ですが、そこに20以上のファイルがあります...期待どおりに機能しないのはなぜですか?
郵便のみ必要なコード – Sajeetharan
PSをこれらの入力です: – limak1109
tbxProgrammLocation: C:プロジェクト\テスト\カミル\ドキュメントは、Visual Studio 2015を\ \ \ユーザーは、 – limak1109