Did you copy, paste and rename a variable? Those red squiggly lines are there to tell you why there is a problem. Hovering your mouse over will give you the clues to fix your syntax error(s). It will say something like:
Quote:
The name 'xxx' does not exist in the current context
where 'xxx' is a variable name.
What do you think is wrong with this line?
ClientContextclientContext = new ClientContext(siteUrl);
This line will give you a hint:
clientContext.ExecuteQuery();
What is this supposed to be?
var securePassword = new();
a string? array of char?
This declaration looks very wrong:
ListItemCreationInformationitemInfo = newListItemCreationInformation();
This looks like a class is either not declared or a using reference is missing:
var onlineCredentials = newSharePointOnlineCredentials(login, securePassword);
Please, do some basic functions first:
1. check for errors when you copy and paste someone else's code
2. make use of those red squiggly lines - very helpful information. Can't stress that enough
3. fix any missing namespace references