小编Aar*_*thi的帖子

如何在net beans中运行node.js文件?

在net beans我安装了node.js pulgin.But我的示例节点程序不工作.我收到错误.这是我的示例代码

    var http = require("http");
    http.createServer(function (req, res) {
    res.writeHead(200, {"Content-Type": "text/plain"});

    res.end("Hai! welcome to node.js...!\n");

      }).listen(3030, "localhost");



   console.log("Server running at http://127.0.0.1:3030/");/* 
Run Code Online (Sandbox Code Playgroud)

在运行上述程序时.我遇到以下错误.

                  module.js:340
                 throw err;
                     ^
         Error: Cannot find module 'C:\Program Files\NetBeans 7.0.1\hello.js'
        at Function.Module._resolveFilename (module.js:338:15)
        at Function.Module._load (module.js:280:25)
        at Function.Module.runMain (module.js:497:10)
        at startup (node.js:119:16)
        at node.js:903:3
Run Code Online (Sandbox Code Playgroud)

但是上面的程序可以在终端上运行.

netbeans node.js

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

如何在c#中插入嵌套集合到mongo db

我想用c#创建这样的集合

   Agent_name: {
    f: "vbv",
    l: "vbvbv"
    },
   "Agent_LoginSessionId" : "",
   "Agent_GroupCode" : "",
   "Agent_dtmCreated" : "",
   "Agent_dtmLastLogin" : "",
   "Agent_strIsActive" : ""

    stamps: {
     ins: "",
     upd: "",
     createUsr: "",
     updUsr: "",
     Ins_Ip: "",
     Upd_IP: ""

 }
Run Code Online (Sandbox Code Playgroud)

我的C#代码是这样的:

MongoCollection<BsonDocument> Agents = mydb.GetCollection<BsonDocument>("Agents");
       BsonDocument collectionAgent = new BsonDocument {
                   { "Agent_Login", Aid },  
                   {"Agent_Pwd",Apwd},
                   {"Agent_Rpwd",Arpwd},

                   Agent_Name:     
                      { "f", Afname},
                      {"l", Alname} ,


                   {"Agent_LoginSessionId",""},
                   {"Agent_GroupCode",AgroupId},
                   {"Status",AStastus}
                  };
       Agents.Insert(collectionAgent)
Run Code Online (Sandbox Code Playgroud)

在C#中如何实现这一目标?它需要任何特定的驱动程序来安装.请提出建议?

c# mongodb

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

无法将文件另存为JSON?

我需要创建一个扩展名为JSON(Json文件)的文件.但我无法创造.当我尝试保存一个带有json扩展名的文件,如文件名后跟一个.JSON,它需要,

  filename.JSON.txt
Run Code Online (Sandbox Code Playgroud)

怎么解决这个?我使用的是Windows 7(32位)操作系统.请提出一些建议???

json

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

标签 统计

c# ×1

json ×1

mongodb ×1

netbeans ×1

node.js ×1