小编And*_*yar的帖子

WhatsApp c#WhatsAPINet - 登录失败:未经授权

感谢这个问题Andre Soares,我设法编写了正确的代码,用于连接WhatsApp并发送简单的消息.

using System;
using WhatsAppApi;
using WhatsAppApi.Register;

namespace WhatsAppBot
{
    class Program
    {
        static void Main(string[] args)
        {
            WhatsApp wa = new WhatsApp("********", "********", "sakher", false, false);
            // I tried with phone numbers like "38xxxxxxx", "+38xxxxxxx". 
            // The phone number wasn't previously registered in WhatsApp.
            // Password was generated using WART. 
            wa.OnConnectSuccess += () =>
            {
                Console.WriteLine("Connected");
                wa.OnLoginSuccess += (phoneNumber, data) =>
                {
                    Console.WriteLine("Connection success!");
                    wa.SendMessage("********", "Hello World!");
                    // Number is correct and registered in …
Run Code Online (Sandbox Code Playgroud)

.net c# whatsapp

9
推荐指数
1
解决办法
6325
查看次数

React App Error'Uncaught ReferenceError:React未定义'

我正在尝试使用react构建一个应用程序,但它不起作用,我无法理解为什么.所有东西都使用babelify进行编译,但它在性能期间会抛出异常.错误如下:未捕获的ReferenceError:未定义React.

这是我的组件文件(BigCard.jsx):

 export var BigCard = React.createClass({
  render: function() {
    var rows = [];
    for (var variable in this.props.pokemon) {
      if (this.props.pokemon.hasOwnProperty(variable) && variable.toString() !== 'id' && variable.toString !== 'name' && variable.toString !== 'image' && variable.toString !== 'types') {
        rows.push(
          <tr>
            <td class='mdl-data-table__cell--non-numeric'>
              {variable}
            </td>
            <td>
              {this.props.pokemon[variable]}
            </td>
          </tr>
        )
      }
    }
    return (
      <div class='mdl-card mdl-shadow--4dp'>
        <div class='mdl-card__title'>
          <img src={this.props.pokemon.image.src} alt='Pokemon' class='bigCard__img'/>
        </div>
        <h2 class='mdl-card__title-text'></h2>
        <div class='mdl-card__supporting-text'>
          <table class='mdl-data-table mdl-js-data-table'>
            <thead>
              <tr>
                <th class='mdl-data-table__cell--non-numeric'>Type</th>
                <th class='mdl-data-table__cell--non-numeric'>{this.props.pokemon.types}</th>
              </tr>
            </thead>
            <tbody> …
Run Code Online (Sandbox Code Playgroud)

javascript npm browserify gruntjs reactjs

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

使用'delete'运算符清除内存时出现'Debug Assertion Failed'错误

我已经尝试了一切,但代码不起作用,我无法理解为什么.

我有两节课.这是基类:

class Vegetables
{
    private:
        char *nameStr;
        char *countrySrc;
        int seasonRd;
    public:
        Vegetables()
        {
            cout << "Default constructor for Vegetables" << endl;
            nameStr = new char[20];
            nameStr = "Unknown";
            countrySrc = new char[20];
            countrySrc = "Unknown";
            seasonRd = -1;
        }

        virtual ~Vegetables()
        {
            delete[]nameStr; //Here happens the error (_crtisvalidheappointer(block))
            delete[]countrySrc;
            cout << "Destructor for Vegetables" << endl;
        }
};
Run Code Online (Sandbox Code Playgroud)

它继承了类'Inherited Unit':

class InhUnit : public Vegetables
{
    private:
        Delivery delivery_;
        Vegetables vegetables;
        int quantity;
        int price;
        int delivPrice;

    public: …
Run Code Online (Sandbox Code Playgroud)

c++ oop visual-c++

0
推荐指数
1
解决办法
495
查看次数

标签 统计

.net ×1

browserify ×1

c# ×1

c++ ×1

gruntjs ×1

javascript ×1

npm ×1

oop ×1

reactjs ×1

visual-c++ ×1

whatsapp ×1