我正在通过终端设置Heroku配置变量,并出现此错误:
zsh:解析“&”附近的错误
我的zsh版本是5.7.1平台:Mac Mojave
这是我正在运行的命令:
heroku config:set vidly_db=mongodb://vidlyuser:mypassword@vidly-shard-00-00-yyjmw.mongodb.net:27017,vidly-shard-00-01-yyjmw.mongodb.net:27017,vidly-shard-00-02-yyjmw.mongodb.net:27017/test?ssl=true&replicaSet=vidly-shard-0&authSource=admin&retryWrites=true
答案 0 :(得分:0)
heroku config:set vidly_db='mongodb://vidlyuser:mypassword@vidly-shard-00-00-yyjmw.mongodb.net:27017,vidly-shard-00-01-yyjmw.mongodb.net:27017,vidly-shard-00-02-yyjmw.mongodb.net:27017/test?ssl=true&replicaSet=vidly-shard-0&authSource=admin&retryWrites=true'
是Zsh(以及Bash和大多数其他Unixy shell)¹中的特殊字符。用引号括住您的价值:
private void button1_Click(object sender, EventArgs e)
{
Excel.Application xlApp = new Excel.Application();
Excel.Workbook xlWorkbook = xlApp.Workbooks.Add();
Excel._Worksheet xlWorksheet = xlWorkbook.Sheets[1];
Excel.Range xlRange = xlWorksheet.UsedRange;
if (xlApp == null)
{
MessageBox.Show("Excel is not installed please intsall it first!");
}
xlWorksheet.get_Range("A1", "B1").Font.Bold = true;
xlWorksheet.get_Range("D1", "E1").Font.Bold = true;
xlWorksheet.get_Range("G1", "H1").Font.Bold = true;
xlWorksheet.get_Range("A1", "H1").VerticalAlignment = Excel.XlVAlign.xlVAlignCenter;
xlWorksheet.get_Range("A1", "H1").HorizontalAlignment = Excel.XlVAlign.xlVAlignCenter;
xlWorksheet.Cells[1, 1] = "Crane Locations";
xlWorksheet.Cells[1, 4] = "Pick Locations";
xlWorksheet.Cells[1, 7] = "Set Locations";
xlWorksheet.Range[xlWorksheet.Cells[1, 1], xlWorksheet.Cells[1, 2]].Merge();
xlWorksheet.Range[xlWorksheet.Cells[1, 4], xlWorksheet.Cells[1, 5]].Merge();
xlWorksheet.Range[xlWorksheet.Cells[1, 7], xlWorksheet.Cells[1, 8]].Merge();
xlWorkbook.SaveAs("C:\\Users\\a_hebiba\\Desktop\\Crane.xlsx", Excel.XlFileFormat.xlWorkbookNormal, Excel.XlSaveAsAccessMode.xlExclusive);
xlApp.Visible = true;
xlApp.UserControl = true;
xlWorkbook.SaveAs("C:\\Users\\a_hebiba\\Desktop\\T-Crane.xlsx", Excel.XlFileFormat.xlWorkbookNormal, Excel.XlSaveAsAccessMode.xlExclusive);
}