最近参考一些资料写得程式
推播的服务端
使用asp classic
广告一下我的程式码笔记网指
里面都是写过可以动的才会放上去
http://dbhills.blogspot.tw/2014/12/gcmserveraspnet.html
<% PushServerURL = "https://android.googleapis.com/gcm/send" ApplicationAPIKey = "AIzaS" RegId = "APA91bEqDLVNxmhjPyNtXmtdXnFsGjiWX_IankBMMg" tickerText = "黑" contentTitle = "哈" message = "120" postJSONData = "" & _ "{" & _ " ""registration_ids"" : [ """ & RegId & """ ]" & _ ", ""data"": {" & _ " ""tickerText"" : """ & tickerText & """" & _ " , ""contentTitle"" : """ & contentTitle & """" & _ " , ""message"" : """ & message & """" & _ " }" & _ "}" Set httpObj = Server.CreateObject("WinHttp.WinHttpRequest.5.1") httpObj.open "POST" , PushServerURL, False httpObj.SetRequestHeader "Content-Type", "application/json" httpObj.SetRequestHeader "Authorization", "key=" & ApplicationAPIKey httpObj.Send postJSONData httpObj.WaitForResponse If httpObj.Status = "200" Then response.Write("GG : " & httpObj.ResponseText) Else response.Write("DD : " & httpObj.ResponseText) End If %>