小编Ada*_*nes的帖子

等待外部过程完成

我有一个被调用的方法,虽然我希望在方法完成后显示消息框(现在在调用方法后直接显示消息框):

if (Check == true)
{
    StartConvIpod();
}
else
{

}
MessageBox.Show("Operation Successful!");
Run Code Online (Sandbox Code Playgroud)

StartConvIpod:

      private void StartConvIpod()
        {

            string res = Directory.EnumerateFiles("dump").
    OrderBy(x => File.GetCreationTime(x)).Last();

            string sub = res.Substring(5);

            string sub2 = sub.Substring(0, sub.Length - 4);


            Process p = new Process();
            p.StartInfo.WorkingDirectory = "dump";
            p.StartInfo.FileName = "ffmpeg.exe";
            p.StartInfo.Arguments = "-i " + sub + " -f mp4 -vcodec mpeg4 -b 700k -aspect 4:3 -r 23.98 -s 320x240 -acodec ac3 -ar 48000 iPodConversions\\" + sub2 + ".mp4";
            p.Start();
}
Run Code Online (Sandbox Code Playgroud)

.net c# windows winforms

7
推荐指数
2
解决办法
7205
查看次数

选择字符串C#的特定部分

我正在尝试创建一个新字符串,从现有字符串中删除某些字符,例如

string path = "C:\test.txt"
Run Code Online (Sandbox Code Playgroud)

所以字符串"pathminus"将取出"C:\",例如

string pathminus = "test.txt"
Run Code Online (Sandbox Code Playgroud)

.net c# windows

2
推荐指数
2
解决办法
6539
查看次数

标签 统计

.net ×2

c# ×2

windows ×2

winforms ×1