简体   繁体   中英

Getting formatexception

I am getting a Formatexception from the below code. I can't seem to fix it. What is wrong? Thanks

var res = dropDown.SelectedValue;
var zip = String.Format("{0}/FileBrowser/FOLDERNAME/filer/" + temp + ", projectPath");

Due to {0} in the format string

"{0}/FileBrowser/FOLDERNAME/filer/" + temp + ", projectPath"

String.Format expects an argument after it.

Did you mean something like

var zip = String.Format("{0}/FileBrowser/FOLDERNAME/filer/{1}", projectPath, temp);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM