Click here to Skip to main content
14,970,700 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
error code cs0131 the left hand side of the assignment must be a variable, property or indexer

the code is in C#
the code line is as follows

SendIrcMessage(":" + userName + "!" + userName = "@" + userName + " PRIVMSG #" + " :" + message);

What I have tried:

I havnt tried anything yet as I am new to coding
Updated 24-Oct-17 12:26pm

1 solution

The error is because of your "=" sign, maybe it should be a "+" or surrounded by quotes.

If it is supposed to be included in the text (ie; You want the your message to be;
":FredS! PRIVMSG#:The message that I want to send is blah")
Then you need to include quotes around the "=" sign. Change your code to the below;
SendIrcMessage(":" + userName + "!" + userName + "=@" + userName + " PRIVMSG #:" + message);

The way you have written it you are trying to assign the value
"@" + userName + " PRIVMSG #:" + message

":" + userName + "!" + userName

Kind Regards

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900