Here called paypal Rest API using System.Net.Http.HttpClient for OAuth 2.0 access token try { // ClientId of your Paypal app API string API ClientId = " ASCxaD7FzuvGbX-xxxxxxxx.....xxxxxxxxxxx-6RZDgwLuOyrCsy3 " ; // secret key of you Paypal app API string API Secret = " ENldyFXuW46R7Wv0 xxxxxxxx.....xxxxxxxxxxx ee8pyH8 " ; using ( var client = new System.Net.Http. HttpClient ()) { var byteArray = Encoding .UTF8.GetBytes( API ClientId + ":" + API Secret ); client.DefaultRequestHeaders.Authorization = new Headers. AuthenticationHeaderValue ( "Basic" , Conv...
Definition : Generics means allows to defining a class or method without particular any data type. It is a improve performance, productivity and type-safety. It is also said parametric polymorphism. It is most commonly use with collections like linked lists, arrays, stacks, queues, hash tables, enumerable queryable, trees etc. Perform operations such as add and delete items from the collection with regardless of the data type. Benefits : Casting is not required for accessing items from the collection Type-safe while execution Reusable code for multiple types of data Improve the performance and productivity Boxing and Unboxing are not required Where List<T> collection class is an example for generic class that can be used for add, remove and search an item of any type (T) that passed as parameter to it. Examples : class SampleClass1<T> : IDisposable { public void D...
try { //Creating the object of MailMessage MailMessage message = new MailMessage(); //Creating the object of SmtpClient SmtpClient smtp = new SmtpClient(); //To Emial Address message.To.Add(new MailAddress("To Email Address")); //From Email Address message.From = new MailAddress("From Email Address"); //It is a subject of your email mess...
Comments
Post a Comment