Posts

Showing posts from January, 2014

How to use DataPager control with Data List View in asp.net c#

Image
UI:

File decryption using c#.net

c# code:             string   InputFile =   Application .StartupPath + "\\ encrptsofttechsolving.xml " ;     // this is excel file, i.e I  wanna to deencrypt                   string   OutputFile = =   Application .StartupPath + "\\softtechsolving.xls " ;     // softtechsolving is file name after decryption of   encrptsofttechsolving.xml             XmlDocument XDoc1 = new XmlDocument ();             try             {                 string password = @"xxxxxxx" ; // Your Key Here                 UnicodeEncoding UE = new UnicodeEncoding ();                 byte [] key = UE.GetBytes(password);                 FileStream fsCrypt = new FileStream (inputFile, FileMode .Open);                 RijndaelManaged RMCrypto = new RijndaelManaged ();                 CryptoStream cs = new CryptoStream (fsCrypt,                     RMCrypto.CreateDecryptor(key, key),                     CryptoStreamMode .Read);       

File encryption using c#.net

try             {                 string InputFile = Application .StartupPath + "\\softtechsolving.xls" ;   // this is excel file, i.e I  wanna to encrypt                 string OutputFile = = Application .StartupPath + "\\encrptsofttechsolving.xml" ;   // encrptsofttechsolving is file name after encryption file name                                                                                                saved that name                   string password = @"xxxxx" ; // Your Key Here                 UnicodeEncoding UE = new UnicodeEncoding ();                 byte [] key = UE.GetBytes(password);                 FileStream fsCrypt = new FileStream (outputFile, FileMode .Create);                 RijndaelManaged RMCrypto = new RijndaelManaged ();                 CryptoStream cs = new CryptoStream (fsCrypt,                     RMCrypto.CreateEncryptor(key, key),                     CryptoStreamMode .Write);  

How to send mail to another email id through gmail provider using c#.net

C# Code: MailMessage Msg = new MailMessage ();             // Sender e-mail address.             string FromMail = "noreplysofttechsolving@gmail.com" ;             string Password = "xxxxxx" ; //sender email password             Msg.From = new MailAddress (FromMail);             // Recipient e-mail address..              string  ToMail = txtEmail.Text;             Msg.To.Add(ToMail);             string MsgBody = "Thank you!!!!" ;             AlternateView htmlMsgView = AlternateView .CreateAlternateViewFromString(MsgBody, null , MediaTypeNames . Text .Html);             Msg.Subject = "SoftTechSolving" ;             //Msg.Body = MsgBody;             Msg.AlternateViews.Add(htmlMsgView);             // your remote SMTP server IP.             SmtpClient smtp = new SmtpClient ();             smtp.Host = "smtp.gmail.com" ;             smtp.Port = 587;             smtp.Credentials = new Sy

How to send mail to another email id using C#.Net

C# Code: MailMessage Msg = new MailMessage ();         string FromMail = "noreply@softtechsolving.com" ;         string Password = "XXXXXXX" ;   //”XXXXXX” is email id password         Msg.From = new MailAddress (FromMail);         // Recipient e-mail address..         string ToMail = txtEmail.Text;         Msg.To.Add(ToMail);         string MsgBody = "welcome to softtechsolving…" ;         AlternateView htmlMsgView = AlternateView .CreateAlternateViewFromString(MsgBody, null , MediaTypeNames . Text .Html);         Msg.AlternateViews.Add(htmlMsgView);         Msg.Subject = "softtechsolving" ;         Msg.Body = MsgBody;         //send the message         SmtpClient smtp = new SmtpClient ( "mail.softtechsolving.com" );         //to authenticate we set the username and password properites on the SmtpClient         smtp.Credentials = new NetworkCredential (FromMail, Password);         sm

How to send mail to another email id with attachment file

C# Code: Attachment at = new Attachment (Server.MapPath(MemberPic)); //for attached file.... 'MemberPic' is file path , is string format…                     MailMessage Msg = new MailMessage ();                     string FromMail = "support@softtechsolving.com" ;                     string Password = "XXXXXX" ;  // "XXXXXX" is sender password…                     Msg.From = new MailAddress (FromMail);                     // Recipient e-mail address..                     string ToMail = "softtechsolving@gmail.com" ;   //Receiver email id…                     Msg.To.Add(ToMail);                     string MsgBody = "Thank you…, Softtechsolving.. plz find attached file.." ;                     AlternateView htmlMsgView = AlternateView .CreateAlternateViewFromString(MsgBody, null , MediaTypeNames . Text .Html);                     Msg.AlternateViews.Add(htmlMsgView);                     Msg.Su

How to Send message to mobile no using c#

c# Code: string ContactNo = "8343094272" ; // to mobile no                  string MessageText = "Welcome to Softtechsolving" ; // your message                 string strUrl = string .Format( "http://api.mVaayoo.com/mvaayooapi/MessageCompose?user=softtechsolving@gmail.com:soft@123&senderID=TEST SMS&receipientno={0}&msgtxt={1}&state=4" , ContactNo, MessageText);                 WebRequest request = HttpWebRequest.Create(strUrl);                 HttpWebResponse response = (HttpWebResponse)request.GetResponse();                 Stream s = ( Stream )response.GetResponseStream();                  StreamReader readStream = new StreamReader (s);                 string dataString = readStream.ReadToEnd();                 response.Close();                 s.Close();                 readStream.Close();