小编Str*_*ker的帖子

iOS的苹果推送通知和使用PHP的Android的谷歌云消息?

我正在寻找可以向ios设备和Android设备发送推送通知的PHP代码.

我个人使用easyapns进行ios推送通知,使用gcm进行android推送通知.

我想合并两个代码并制作一个代码,用于发送两个设备的推送通知.

我正在研究php部分.有什么解决方案可以让它变得简单吗?

php notifications android push-notification ios

6
推荐指数
1
解决办法
879
查看次数

如何在控制器类中调用模型类

MVC4

这是我在控制器文件夹中的控制器类

public class UserController : Controller
{
    //
    // GET: /User/
    private static Users _users = new Users();
    public ActionResult Index()
    {
        return View(_users._userList);
    }

    public ActionResult UserAdd()
    {
        return View();
    }
    [HttpPost]
    public ActionResult UserAdd(UserModels userModel)
    {
        _users.CreateUser(userModel);
        return View();
    }

}
Run Code Online (Sandbox Code Playgroud)

错误 2 找不到类型或命名空间名称“用户”

错误 3 找不到类型或命名空间名称“UserModels”

这是我在模型文件夹中的用户类

 public class Users
    {
        public Users()
        {
            _userList.Add(new UserModels
            {
                FirstName = "birbal ",
                LastName = "kumar",
                Address = "new delhi",
                Email = "example@gmail.com",
                DOB = Convert.ToDateTime("2/11/1991"),
                salary = …
Run Code Online (Sandbox Code Playgroud)

c# asp.net controller class asp.net-mvc-4

5
推荐指数
1
解决办法
3万
查看次数

php script facebook(#100)无权发布视频

我正在尝试使用此代码在Facebook页面上传视频.我添加了所有必填凭据以添加视频.但当我选择视频并点击上传按钮时,json请求说你没有上传视频的权限.我试图调试此问题,但无法成功.请帮帮我.谢谢

 <?php
$app_id = "xxxxxxxxxxxxxxx";
$app_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$my_url = "http://xxxxxxxx/test.php";
$video_title = "test_video_for_app";
$video_desc = "test_description";
$page_id = "xxxxxxxxxxxxxxxx"; // Set this to your APP_ID for Applications

$code = $_REQUEST["code"];

echo '<html><body>';

if(empty($code)) {
  // Get permission from the user to publish to their page. 
  $dialog_url = "http://www.facebook.com/dialog/oauth?client_id=". $app_id . "&redirect_uri=" . urlencode($my_url). "&scope=publish_actions,manage_pages";
  echo('<script>top.location.href="' . $dialog_url . '";</script>');
} else {

  // Get access token for the user, so we can GET /me/accounts
  $token_url = "https://graph.facebook.com/oauth/access_token?client_id=". $app_id . …
Run Code Online (Sandbox Code Playgroud)

php video facebook

3
推荐指数
1
解决办法
5869
查看次数

如何在MVC 4中添加视图

我正在使用本教程制作一个简单的mvc应用程序.

当我尝试添加名为UserAdd的视图时,我遇到了问题

在我的情况下,添加视图窗口不会出现在我们选择视图引擎,模型类和脚手架模板.

我在做的是:

  1. 右键单击模型文件夹
  2. 然后添加新项目
  3. 然后选择mvc4查看页面(剃须刀)
  4. 将其命名为UserAdd
  5. 点击添加按钮

当我单击"添加"按钮时,它会直接打开UserAdd.cshtml页面.

我的问题是:

如何打开添加视图窗口?

c# asp.net asp.net-mvc razor asp.net-mvc-4

2
推荐指数
1
解决办法
1347
查看次数