小编Kri*_*ndi的帖子

通用应用程序(C#)上未列出的HTML Agility Pack SelectSingleNode方法

我正在使用C#开发一个简单的Web抓取应用程序,这是我的代码,用于加载从服务器接收的HTML代码HtmlDocument.

string html = res.Content.ToString();
HtmlDocument htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(html);
Run Code Online (Sandbox Code Playgroud)

每当我尝试使用该htmlDoc.DocumentNode.SelectSingleNode方法时,我收到此错误:

"Html节点不包含SelectSingleNode的引用".

我错过了什么吗?

我正在Visual Studio 2015中开发一个通用应用程序.使用Nuget管理器下载并安装了html敏捷包.

c# html-agility-pack

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

Node.js ssh2隧道保持活动并执行mysql查询

我实施rest api使用node.js使用ssh2 package隧道连接到remote mysql database。这是我用来通过ssh连接并执行的代码query

executeQuery : function(query, callback) {
        var sshConnected = false;
        var connection = require('ssh2').Client();
        var server = require('net').createServer(function(sock) {
            if (!sshConnected) return sock.end();
            connection.forwardOut(
                '127.0.0.1',
                sock.remotePort,
                '127.0.0.1',
                3306,
                function (err, stream) {
                    if (err) return sock.end();
                    stream.pipe(sock).pipe(stream);
                });
        });
        connection.on('ready', function() {
            console.log('Client :: ready');
            sshConnected = true;
            server.listen(3306);
            var sqlconn = require('mysql').createConnection(config.dbOrg);
            sqlconn.connect(function (conError) {
                if (!conError) {
                    console.log(query);
                    sqlconn.query({sql: query.sql, values: query.values}, function (qError, results, …
Run Code Online (Sandbox Code Playgroud)

mysql ssh tcp node.js

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

Android下载管理器失败错误

我一直面临着特定网址的这个问题.每当我尝试使用android管理器下载文件时,我都会收到下载失败的错误.当我尝试与其他下载管理器相同的链接时说ES File Downloader,它运行正常.

这是我从URI下载的代码.

try{
    uri = Uri.parse(urls.get(countLinks));
    }catch(Exception e)
    {
        Log.d("Caught inside uri", e.toString());
    }
Run Code Online (Sandbox Code Playgroud)

和下载管理器在这里

Toast.makeText(getApplicationContext(), "Download Started", Toast.LENGTH_SHORT).show();;
            DownloadManager.Request songDownload = new DownloadManager.Request(uri);
            songDownload.setTitle(title);
            songDownload.setDescription("Simple Mp3 Downloader...");
            songDownload.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
            songDownload.setDestinationInExternalPublicDir(Environment.DIRECTORY_MUSIC, (title+".mp3") );
            songDownload.allowScanningByMediaScanner();
            DownloadManager dm = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
            dm.enqueue(songDownload);
Run Code Online (Sandbox Code Playgroud)

在此过程中,logcat中没有显示错误.但下载管理器显示不成功.:这是一个示例链接

android download

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

标签 统计

android ×1

c# ×1

download ×1

html-agility-pack ×1

mysql ×1

node.js ×1

ssh ×1

tcp ×1