我想在我的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) 我正在尝试使用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) 如果客户端使用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) node.js ×2
.net ×1
c# ×1
javascript ×1
mysql ×1
npm ×1
socketrocket ×1
sockets ×1
websocket ×1
windows-10 ×1
windows-rt ×1