小编Wal*_*jad的帖子

如何在Windows 10应用程序中实施应用程序内购买?

我想在我的Windows通用应用程序中集成应用程序内购买.我在编码前做了以下事情.

  • Windows开发人员中心制作应用程序

  • 加入产品在单边行动计划部分细节,并提交到商店,你可以在看图片

  • 之后,我在我的应用程序中使用以下代码获取应用程序内购买产品列表和购买产品按钮.我也使用CurrentApp而不是CurrentAppSimulator在我的代码中,但它是异常的.
private async void RenderStoreItems()
    {
        picItems.Clear();

        try
        {
            //StoreManager mySM = new StoreManager();
            ListingInformation li = await CurrentAppSimulator.LoadListingInformationAsync();

            System.Diagnostics.Debug.WriteLine(li);

            foreach (string key in li.ProductListings.Keys)
            {
                ProductListing pListing = li.ProductListings[key];
                System.Diagnostics.Debug.WriteLine(key);

                string status = CurrentAppSimulator.LicenseInformation.ProductLicenses[key].IsActive ? "Purchased" : pListing.FormattedPrice;

                string imageLink = string.Empty;

                picItems.Add(
                    new ProductItem
                    {
                        imgLink = key.Equals("BaazarMagzine101") ? "block-ads.png" : "block-ads.png",
                        Name = pListing.Name,
                        Status = status,
                        key = key,
                        BuyNowButtonVisible = CurrentAppSimulator.LicenseInformation.ProductLicenses[key].IsActive ? false : true …
Run Code Online (Sandbox Code Playgroud)

.net c# windows-rt win-universal-app windows-10

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

错误:连接ETIMEDOUT

我正在尝试使用Node和Mysql但我在尝试连接数据库时遇到了错误.

 //For mysql server
var mysql = require('mysql');

var connection = mysql.createConnection(
{
  host: 'example.com',
  user: 'abc',
  password: '***',
  database: 'abcd',
  port: 3306,
});
// If there is an error connecting to the database
connection.connect( function(err)
{
  if (err)
  { 
    throw err;
  }
  else 
  {
    console.log('DB connection establish');
  }
});

function check_userid(usersId)
{
var que = connection.query(
  'select * from table where id = '+usersId, function(err, result, fields){
  if(err) throw err;
  console.log('Resultset: ', result);
  console.log('Length of Resultset: ', result.length);

  if(result.length …
Run Code Online (Sandbox Code Playgroud)

javascript mysql node.js

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

Web套接字:无法在Internet断开连接上检测到客户端连接

如果客户端使用Web套接字关闭Internet,我想检测客户端连接。我的代码是:

 //Include util library
    var util = require('util');
    // Include underscore library
    var _ = require('underscore')._;
    //For websocket
var webSocketServer = new (require('ws')).Server({port: (process.env.PORT || 5000)}),
webSockets = {} // userID: webSocket

// CONNECT /:userID
// wscat -c ws://localhost:5000/1
webSocketServer.on('connection', function (webSocket) 
{
  var userID = webSocket.upgradeReq.url.substr(1);
  //console.log('User_id is ',userID);
  webSockets[userID] = webSocket
                   util.log('User_id: [' + userID + '] enter in connected users list of [ ' + Object.getOwnPropertyNames(webSockets)+' ]')
                   // Call function which check id exist in letswalkee DB …
Run Code Online (Sandbox Code Playgroud)

sockets websocket node.js npm socketrocket

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