VARのパス= @ " E:\ 1 " ; VaRの processidを= " 1 " ; // 要创建文件夹的名称 VAR VideoPath = 文字列.Empty。 VARファイルパス= Path.Combine(パス、$ " {processidを} " ); もし(!Directory.Exists(ファイルパス)) { Directory.CreateDirectory(ファイルパス); VideoPath = ファイルパス。 } 他 { int型 I = 1; ブール状態= 偽; VaRの filepath2 = 文字列.Empty。 しばらく(!ステータス= 真) { VAR C = processidを+ $ " ({I})" 。 filepath2 = Path.Combine(パス、$ " {C} " )。 もし(!Directory.Exists(filepath2)) { Directory.CreateDirectory(filepath2)。 状態 = 真; } 他 { I ++ 。 } } もし(ステータス) { VideoPath = filepath2。 } }