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:
  stringInputFile =Application.StartupPath +"\\ encrptsofttechsolving.xml ";  // this is excel file, i.e I  wanna to deencrypt stringOutputFile = =Application.StartupPath +"\\softtechsolving.xls ";  // softtechsolving is file name after decryption of encrptsofttechsolving.xml             XmlDocument XDoc1 = newXmlDocument(); try             { string password = @"xxxxxxx"; // Your Key Here
UnicodeEncoding UE = newUnicodeEncoding(); byte[] key = UE.GetBytes(password);
FileStream fsCrypt = newFileStream(inputFile, FileMode.Open);
RijndaelManaged RMCrypto = newRijndaelManaged();
CryptoStream cs = newCryptoStream(fsCrypt,                     RMCrypto.CreateDecryptor(key, key), CryptoStreamMode.Read);
FileStream fsOut = newFileStream

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 = newUnicodeEncoding(); byte[] key = UE.GetBytes(password);
FileStream fsCrypt = newFileStream(outputFile, FileMode.Create);
RijndaelManaged RMCrypto = newRijndaelManaged();
CryptoStream cs = newCryptoStream(fsCrypt,                     RMCrypto.CreateEncryptor(key, key), CryptoStreamMode.Write);
FileStream fsIn = newFileStream(inputFile, FileMode.Open);
int data; while ((data = fsIn.ReadByte()) != -1)                     cs.WriteByte((byte)data);

                fsIn.Close();                 cs.Close();                 fs…

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

C# Code:
MailMessage Msg = newMailMessage(); // Sender e-mail address. string FromMail = "noreplysofttechsolving@gmail.com"; string Password = "xxxxxx"; //sender email password             Msg.From = newMailAddress(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 = newSmtpClient();             smtp.Host = "smtp.gmail.com";             smtp.Port = 587;             smtp.Credentials = new System.Net.NetworkCredential(FromMail, Password);             smtp.EnableSsl = true;             smtp.Send(Msg);             Msg = null;

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

C# Code:
MailMessage Msg = newMailMessage(); string FromMail = "noreply@softtechsolving.com"; string Password = "XXXXXXX";   //”XXXXXX” is email id password         Msg.From = newMailAddress(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 = newSmtpClient("mail.softtechsolving.com");
//to authenticate we set the username and password properites on the SmtpClient         smtp.Credentials = newNetworkCredential(FromMail, Password);         smtp.Send(Msg);

How to send mail to another email id with attachment file

C# Code:
Attachment at = newAttachment(Server.MapPath(MemberPic)); //for attached file.... 'MemberPic' is file path , is string format… MailMessage Msg = newMailMessage(); string FromMail = "support@softtechsolving.com"; string Password = "XXXXXX";  // "XXXXXX" is sender password…                     Msg.From = newMailAddress(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.Subject = "Soft-Tech Solving;                     Msg.Body = MsgBody;
//send the message SmtpClient smtp = newSmtpClient("mail.softtechsolving.com");
//to authenticate we set the username and pas…

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 = newStreamReader(s); string dataString = readStream.ReadToEnd();                 response.Close();                 s.Close();                 readStream.Close();