给软件加控制功能,可以随时中断使用

给软件加控制功能,可以随时中断使用

public void RemoteCtrl()
{
    WebClient web = new WebClient();
    web.Encoding = Encoding.UTF8;
    string json = web.DownloadString("http://softapi.ilinshu.cn/softinfo/query/1" );
    SoftInfo si = JsonConvert.DeserializeObject<SoftInfo >(json);
    if (si.State != 0)
    {
        MessageBox.Show(si.ErrorMessage, "内部错误" , MessageBoxButtons .OK, MessageBoxIcon.Stop);
        Environment.Exit(0);
        return;
    }
}

kindeditor获取不到内容的解决办法

kindeditor获取不到内容的解决办法

var editorMini = KindEditor.create('.editor-mini', {
    width: '98%',
    height: '450px',
    resizeType: 1,
    items: [
        'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
        'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
        'insertunorderedlist', '|', 'emoticons', 'link'],
        afterBlur: function() {
            this.sync();
        }
});

在 KindEditor.create中增加

afterBlur: function() {
    this.sync();
}

this.sync()说明:这个函数就是同步 KindEditor 的值到 textarea文本框。

官方解释:

sync()
将编辑器的内容设置到原来的textarea控件里。