0
Use of unassigned local variable 'folderPath'
當我使用此代碼:
string folderPath = folderPath.Substring(folderPath.IndexOf(@"\") + 1) + @"C:\test\" + "_converted";
如何解決呢?
Use of unassigned local variable 'folderPath'
當我使用此代碼:
string folderPath = folderPath.Substring(folderPath.IndexOf(@"\") + 1) + @"C:\test\" + "_converted";
如何解決呢?
您正在創建一個字符串,並且正在嘗試訪問該字符串。這沒有意義。
如果folderPath
是現有變量,要麼重用變量:
folderPath = folderPath ...
或者創建一個變量與另一名:
string folderPath2 = folderPath ...
有工作!謝謝! –