try
{
TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
string timestamp = Convert.ToInt64(ts.TotalSeconds).ToString();
string appkey = string.Empty;
string app_master_secret = string.Empty;
var param = new object();
if (model.platform == "android")
{
appkey = System.Configuration.ConfigurationManager.AppSettings["android_appkey"];
app_master_secret = System.Configuration.ConfigurationManager.AppSettings["android_App_Master_Secret"];
param = new
{
appkey = appkey,
timestamp = timestamp,
type = model.type,
device_tokens = model.device_tokens == null ? "" : model.device_tokens,
payload = new
{
body = new
{
ticker = model.ticker,
title = model.title,
&nb
{
TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
string timestamp = Convert.ToInt64(ts.TotalSeconds).ToString();
string appkey = string.Empty;
string app_master_secret = string.Empty;
var param = new object();
if (model.platform == "android")
{
appkey = System.Configuration.ConfigurationManager.AppSettings["android_appkey"];
app_master_secret = System.Configuration.ConfigurationManager.AppSettings["android_App_Master_Secret"];
param = new
{
appkey = appkey,
timestamp = timestamp,
type = model.type,
device_tokens = model.device_tokens == null ? "" : model.device_tokens,
payload = new
{
body = new
{
ticker = model.ticker,
title = model.title,
&nb

这篇博客介绍了如何使用C#进行WebAPI调用友盟U-Push接口来发送消息。通过MD5加密方法处理请求参数,确保消息的安全性。

442

被折叠的 条评论
为什么被折叠?



