Advertisement
sandunfx

Untitled

Nov 9th, 2018
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. public string SendSMS(string number)
  2. {
  3.  
  4. Stream streamMsg = new MemoryStream();
  5. string responceMsgStr = string.Empty;
  6.  
  7. string transactionId = GetTransactionId();
  8. string password = GetPassword();
  9.  
  10. using (var client = new WebClient())
  11. {
  12. try
  13. {
  14. var values = new NameValueCollection
  15. {
  16. { "TransactionId", transactionId },
  17. { "PhoneNumber", number },
  18. { "Message", "The OTP for digital application is "+ password + ". Please use this OTP to complete the application."},
  19. { "Priority", "1" },
  20. { "User", "SMS123" },
  21. { "Password", "qw12@!" }
  22. };
  23.  
  24.  
  25.  
  26. var response = client.UploadValues(Properties.Settings.Default.otp, values);
  27.  
  28. var responseString = Encoding.Default.GetString(response);
  29.  
  30. return password;
  31. }
  32. catch (Exception ex)
  33. {
  34.  
  35. return "1111";
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement