本文介绍了需要在VB中转换为C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞!<pre lang="vb"> Private Sub Start_Click(sender As Object, e As EventArgs) Handles Start.Click If VideoPath.Text = "" Then MessageBox.Show("YOU NEED TO ADD THE VIDEO PATH!") ElseIf OutpuPath.Text = "" Then MessageBox.Show("YOU NEED TO ADD THE OUTPUT PATH!") ElseIf Srt.Checked Then Shell("cmd.exe /k" + "ffmpeg -i " + VideoPath.Text + " " + APBtn.Text + " -acodec copy -map_metadata -1 -vf " + "subtitles=" + SubtitlePath.Text + " " + OutpuPath.Text + " -y") Else Shell("cmd.exe /k" + "ffmpeg -i " + VideoPath.Text + " " + APBtn.Text + " -acodec copy -map_metadata -1 -vf " + "ass=" + SubtitlePath.Text + " " + OutpuPath.Text + " -y") End If End Sub NEED转换为C# 我尝试了什么:NEED Converted To C#What I have tried:<pre><pre lang="vb"> Private Sub Start_Click(sender As Object, e As EventArgs) Handles Start.Click If VideoPath.Text = "" Then MessageBox.Show("YOU NEED TO ADD THE VIDEO PATH!") ElseIf OutpuPath.Text = "" Then MessageBox.Show("YOU NEED TO ADD THE OUTPUT PATH!") ElseIf Srt.Checked Then Shell("cmd.exe /k" + "ffmpeg -i " + VideoPath.Text + " " + APBtn.Text + " -acodec copy -map_metadata -1 -vf " + "subtitles=" + SubtitlePath.Text + " " + OutpuPath.Text + " -y") Else Shell("cmd.exe /k" + "ffmpeg -i " + VideoPath.Text + " " + APBtn.Text + " -acodec copy -map_metadata -1 -vf " + "ass=" + SubtitlePath.Text + " " + OutpuPath.Text + " -y") End If End Sub NEED转换为C#NEED Converted To C#推荐答案private void Start_Click(object sender, EventArgs e) { if (VideoPath.Text == "") MessageBox.Show("YOU NEED TO ADD THE VIDEO PATH!"); else if (OutpuPath.Text == "") MessageBox.Show("YOU NEED TO ADD THE OUTPUT PATH!"); else if (Srt.Checked) Shell("cmd.exe /k" + "ffmpeg -i " + VideoPath.Text + " " + APBtn.Text + " -acodec copy -map_metadata -1 -vf " + "subtitles=" + SubtitlePath.Text + " " + OutpuPath.Text + " -y"); else Shell("cmd.exe /k" + "ffmpeg -i " + VideoPath.Text + " " + APBtn.Text + " -acodec copy -map_metadata -1 -vf " + "ass=" + SubtitlePath.Text + " " + OutpuPath.Text + " -y"); } 这篇关于需要在VB中转换为C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-14 08:59