小编Jai*_*esh的帖子

获取是否存在注册表项如果是,则执行此操作,如果不这样做

因此,在我的注册表中,我在"LocalMachine\SOFTWARE\Microsoft\Windows\CurrentVersion\Run \"下输入名为"COMODO Internet Security"的条目,这是我的防火墙.现在我想知道的是如何让注册表检查该条目是否存在?如果它确实如此,那么这样做.我知道如何检查子项"Run"是否存在但不是"COMODO Internet Security"的条目,这是我用来获取子密钥的代码.

                using (RegistryKey Key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run\"))
                if (Key != null)
                {

                    MessageBox.Show("found");
                }
                else
                {
                    MessageBox.Show("not found");
                }
Run Code Online (Sandbox Code Playgroud)

c# registry get

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

如何在GSMComm库中连接长短信?

这是我的代码:

根据这个页面,CreateConcatTextMessage方法返回一个类型的数组,SmsSubmitPdu[]但是,当我尝试发送它时,SendMessages我得到一个MessageServiceError 500.我错过了什么?

       SmsSubmitPdu[] pdu2;

        try{
            pdu2 = SmartMessageFactory.CreateConcatTextMessage("My name is Barry Allen. And I am the fastest man alive. When I was a child I saw my mother killed by something impossible. My father went to prison for her murder.", "+639234597676");
            comm.SendMessages(pdu2);
        }

        catch (MessageServiceErrorException e500){
            MessageBox.Show(e500.ToString(), "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }
        catch (CommException e501){
            MessageBox.Show(e501.ToString(), "Information", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }
Run Code Online (Sandbox Code Playgroud)

c# sms gsm pdu gsmcomm

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

如何使用Ssl Stream获取/存储客户端证书?

我使用MSDN sslstream文章创建了TCP客户端/服务器应用程序.客户端和服务器都正常工作.我还将ssl证书附加到客户端和服务器.

当我运行客户端和服务器程序时,服务器始终定义"RemoteCertificate = null".我想读取客户端证书并将该证书复制/存储到存储.

我还有使用X509Store Class 存储证书的演示程序.现在唯一的问题是获得客户端证书.

这是服务器的代码:

using System;
using System.Collections;
using System.Net;
using System.Net.Sockets;
using System.Net.Security;
using System.Security.Authentication;
using System.Text;
using System.Security.Cryptography.X509Certificates;
using System.IO;

namespace Examples.System.Net
{
    public sealed class SslTcpServer
    {
        static X509Certificate serverCertificate = null;

        public static void RunServer(string certificate)
        {
            serverCertificate = X509Certificate.CreateFromCertFile(certificate);

            TcpListener listener = new TcpListener(IPAddress.Any, 8080);
            listener.Start();
            while (true)
            {
                Console.WriteLine("Waiting for a client to connect...");

                TcpClient client = listener.AcceptTcpClient();
                ProcessClient(client);
            }
        }
        static void ProcessClient(TcpClient client)
        { …
Run Code Online (Sandbox Code Playgroud)

c# asp.net security ssl

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

在现有的Xamarin.Forms共享应用程序中实现Prism

我想知道在现有的Xamarin.Forms共享项目中有一种有效的方法来实现Prism.我相信其他人也想知道他们是否可以从Prism提供的产品中获利,而无需将他们现有的项目转换为PCL项目.我发现的所有现有示例都显示了一个PCL项目(​​可能是有充分理由的).

为了在我的项目中尝试实现Prism,我将Prims.Unity.Forms nuget安装到每个平台项目中.我试图从PrismApplication继承:

public partial class App : PrismApplication 
{ }
Run Code Online (Sandbox Code Playgroud)

但是,这不起作用.app类不允许我从不同的基类继承.

将以下行添加到我的android项目没有帮助:

protected override void OnCreate(Bundle bundle)
{      
   LoadApplication(new App(new AndroidInitializer()));
}

public class AndroidInitializer : IPlatformInitializer
{
   public void RegisterTypes(IUnityContainer container)
   { }
}
Run Code Online (Sandbox Code Playgroud)

也许我错过了一些东西或尝试在结构上不可能的东西.

c# prism xamarin xamarin.forms

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

为什么我的G Suite Marketplace应用程序的状态始终显示:GAM:待处理?

我已经发布了G Suite市场应用程序一个月的大部分时间,但是状态始终为“ GAM:待处理”,没有人告诉我我的应用程序是否有问题,我不知道该怎么办我为这种情况做吗?

google-apps-marketplace

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

如何在Vue-router中使用addroutes方法?

我创建了一个函数“ addroute()”来动态添加路由,但是它不起作用(路由器未更改)。这是使用addRoutes方法的正确方法吗?我从教程中学到了这一点。如果没有,那么给我一个正确的例子,谢谢!

...
const Bar={
    template:'#panels',
    data(){
        return {title:'badss'}          
    }
        };
const Foo={
    template:"#panels",
        data(){
        return {title:'hell'}
    }
        };


const router = new VueRouter({
  routes:[
      {path:'/foo',component:Foo},
      {path:'/bar',component:Bar}
  ]
});

new Vue({
    el:'#root',
    router:router,
    data:{
    stats:stats
},
methods: {
    //
},

});

function addroute(){//watch here
    router.addRoutes([{path:'/ioio',component:{template:'#panels'}}])
}
setInterval("addroute()", 2000)//watch here
...
Run Code Online (Sandbox Code Playgroud)

javascript ecmascript-6 vue.js vue-router

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

使用Multipart的文件上传在nodejs中失败

我正在尝试使用multipart上传节点js中的文件,我得到了无法POST错误?我对节点js完全不熟悉.你能帮我解决一下我的错误吗?HTML

<form id   = "uploadForm"
     enctype   = "multipart/form-data"
     action    = "/api/uploadfile"
     method    = "post">
<input type="file" name="fileUpload"/>
<input type="submit" value="Upload File" name="submit">
</form>
Run Code Online (Sandbox Code Playgroud)

Server.js

var express  = require('express');
var app      = express();
var multer  =   require('multer');
app.use(express.static(__dirname));
app.get('/', function(request, response){
    response.sendFile("./index.html"); 
});

var storage =   multer.diskStorage({
  destination: function (req, file, callback) {
    callback(null, './uploads');
  },
  filename: function (req, file, callback) {
    callback(null, file.fieldname + '-' + Date.now());
  }
});
var upload = multer({ storage : storage}).single('fileUpload');


app.post('/api/uploadfile',function(req,res){
    upload(req,res,function(err) {
        if(err) …
Run Code Online (Sandbox Code Playgroud)

javascript node.js multer

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