小编jer*_*ran的帖子

Cocoa和Swift中的简单可点击链接

我为Mac 10.11在Swift中编写了一个桌面应用程序,我想添加一个链接到About页面。

非常像这样:https : //developer.apple.com/library/mac/qa/qa1487/_index.html

我找不到很好的教程或参考。

任何帮助将非常感激

cocoa hyperlink swift

6
推荐指数
3
解决办法
2913
查看次数

在Console中工作但在Windows窗体中不工作的异步代码

我正在尝试编写一个不断在局域网上搜索主机的应用程序.当我作为控制台运行它作为倒计时.Wait()似乎工作正常.但是,当我将代码带入windows窗体时,countdown.Signal()似乎没有减少它的计数器.不确定是什么问题.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.NetworkInformation;
using System.Diagnostics;
using System.Net;
using System.Threading;

namespace Multi_Threaded
{
    public partial class Form1 : Form
    {

    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        PortScanner ps = new PortScanner();
        ps.ProbeCompleted += new PingProbeCompleted(ps_ProbeCompleted);

        ps.run_ping_probe();
    }

    void ps_ProbeCompleted(object sender, PingProbeCompletedArguments e)
    {
        MessageBox.Show("I found " + e.ip_adresses_list_of_host.Count.ToString() + "host(s)");
    }
}

public delegate void PingProbeCompleted(object sender,PingProbeCompletedArguments e);
public …
Run Code Online (Sandbox Code Playgroud)

c# multithreading asynchronous winforms

5
推荐指数
2
解决办法
1575
查看次数

perl regex多个组

我正在尝试在perl中进行屏幕刮擦,并将其归结为一组表元素.

字符串:

<tr>
        <td>10:11:00</td>
        <td><a href="/page/controller/33">712</a></td>
        <td>Start</td>
        <td>Finish</td>
        <td>200</td>
        <td>44</td>
Run Code Online (Sandbox Code Playgroud)

码:

if($item =~ /<td>(.*)?<\/td>/)
            {
                print "\t$item\n";
                print "\t1: $1\n";
                print "\t2: $2\n";
                print "\t3: $3\n";
                print "\t4: $4\n";
                print "\t5: $5\n";
                print "\t6: $6\n";
            }
Run Code Online (Sandbox Code Playgroud)

输出:

1: 10:11:00
2: 
3: 
4: 
5: 
6: 
Run Code Online (Sandbox Code Playgroud)

我尝试了多种方法,但无法获得预期的结果.想法?

regex perl screen-scraping html-parsing

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