Created
August 12, 2016 20:00
-
-
Save arpagon/78f529190c431caea9528091a2d455fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void btnBounces_Click(object sender, EventArgs e) | |
{ | |
try | |
{ | |
string host = "https://sms.dialbox.com.co:52291"; | |
string salt_token = "PassworsdFuerteEnviadoEnLaDocumentaicon"; | |
string metodo = "sms/dcti"; | |
string pbx_id = "10"; | |
string device = "*gmovistar"; | |
string telefono = "39999999"; | |
string mensage = Server.URLEncode("Gracias Por Contactarnos..") | |
string url = host + "/" + salt_token + "/" + metodo + "/" + pbx_id + "/" + device + "/" + telefono + "/" + mensage | |
// Llamar al API Rest Dialbox DCTI | |
GetResult(url); | |
} | |
catch (Exception ex) | |
{ | |
lblError.Text = ex.Message.ToString(); | |
} | |
} | |
public void GetResult(string url) | |
{ | |
WebRequest myReq = WebRequest.Create(url); | |
myReq.Method = "GET"; | |
UTF8Encoding enc = new UTF8Encoding(); | |
WebResponse wr = myReq.GetResponse(); | |
Stream receiveStream = wr.GetResponseStream(); | |
StreamReader reader = new StreamReader(receiveStream, Encoding.UTF8); | |
string content = reader.ReadToEnd(); | |
Response.Write(content) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment