2
Answers

Interface reference varibles.

Photo of Sandeep Kumar

Sandeep Kumar

7y
135
1
What is the difference between the below 2 statements and when to use what?
 
1) IList<string> stdList = new List<string>();
 
2) List<string> stdList = new List<string>(); 
 
 
 
 

Answers (2)

1
Photo of Nilesh Shah
NA 22.3k 215.1k 7y
Hi Kasuni,
 
Glad to know it worked for you.
 
Can I request to mark my answer as "accepted" and close this question.
 
I suggest you to always do that once your problem is solved by anyone.
Accepted
1
Photo of Kasuni Abegunawardana
NA 137 7.6k 7y
@Nilesh Shah  Thankyou so much its working :-)
1
Photo of Nilesh Shah
NA 22.3k 215.1k 7y
login to your gmail account and do this setting:
https://www.google.com/settings/security/lesssecureapps 
 
 
 
1
Photo of Nilesh Shah
NA 22.3k 215.1k 7y
it's simple spelling mistake. it is smtp, you have written smpt
 
this line
  1. SmtpClient tsmtpClient = new SmtpClient("smpt.gmail.com", 587); 
should be changed to :
  1. SmtpClient tsmtpClient = new SmtpClient("smtp.gmail.com", 587); 
0
Photo of Kasuni Abegunawardana
NA 137 7.6k 7y
Thank you so much. I changed into "smtp".
 
then i got an error like this.
 
Server Error in '/' Application.
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
Source Error:
Line 66: //pass account information to the sender Line 67: tsmtpClient.Credentials = new System.Net.NetworkCredential("foodcaloriecalculator@gmail.com", "kasuchin321"); Line 68: tsmtpClient.Send(tmailmessage); Line 69: Line 70: