moonans(was:从ASP.Net/C#?)中运行PHP脚本)

moonans(was:从ASP.Net/C#?)中运行PHP脚本),c#,php,ios,web-services,apple-push-notifications,C#,Php,Ios,Web Services,Apple Push Notifications,我有一个PHP脚本(取自)向iOS应用程序发送APNS通知,但该应用程序的web服务是用C#/ASP.Net编写的 我已经设法在服务器上安装了PHP,并从命令行测试了脚本,但不知道如何在web服务中实现这一点(或者即使这是可能的) 有没有一种方法可以从ASP.Net中运行PHP文件,或者我最好尝试用C#重新编写PHP脚本 -编辑- 出现了更多搜索,这促使我尝试以下代码,但没有成功: public void PushNotificationAlert() { string call = @

我有一个PHP脚本(取自)向iOS应用程序发送APNS通知,但该应用程序的web服务是用C#/ASP.Net编写的

我已经设法在服务器上安装了PHP,并从命令行测试了脚本,但不知道如何在web服务中实现这一点(或者即使这是可能的)

有没有一种方法可以从ASP.Net中运行PHP文件,或者我最好尝试用C#重新编写PHP脚本

-编辑- 出现了更多搜索,这促使我尝试以下代码,但没有成功:

public void PushNotificationAlert()
{
    string call = @"""php.exe""";
    string param1 = @"-f";
    string param2 = @"""~\APNS\myPush.php""";

    Process myProcess = new Process();
    ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(call);
    myProcessStartInfo.UseShellExecute = false;
    myProcessStartInfo.RedirectStandardOutput = true;
    myProcessStartInfo.Arguments = string.Format("{0} {1}", param1, param2);
    myProcess.StartInfo = myProcessStartInfo;

    myProcess.Start();
    StreamReader myStreamReader = myProcess.StandardOutput;
}

如果有人仍然感兴趣,这就是我在Moon上使用的代码,它最终起到了作用:

// use MoonAPNS to send push notification
NotificationPayload payload = new NotificationPayload(deviceToken, message, badge, "default");
var notificationList = new List<NotificationPayload>() { payload };   
PushNotification push = new PushNotification(true, p12file, p12pass);
var result = push.SendToApple(notificationList);
//使用moonans发送推送通知
NotificationPayload payload=新的NotificationPayload(设备通话、消息、徽章,“默认”);
var notificationList=新列表(){payload};
PushNotification push=新的PushNotification(true,p12文件,p12过程);
var结果=push.SendToApple(通知列表);

已经有很多C#APNS项目:新的和改进的版本:另一个:感谢链接。我已经试过了,但不断地出现证书错误。我来看看这两个,看看我是否过得更好。