小编lmk*_*mkk的帖子

用于生成QR码的JavaScript API

我正在寻找一个用于生成QR码(名称,地址等)的JavaScript API,并以可打印的格式输出它们(png/jpeg/pdf).在我看来,这似乎是其他人必须要有的东西.

javascript qr-code

10
推荐指数
2
解决办法
3万
查看次数

使用jsonp获取xml跨域

我试图从另一台服务器读取xml到一个网页,我认为我的问题是同源策略,因此是一个跨域问题.

我有一点谷歌搜索,似乎jsonp是前进的方式.根据我在stackoverflow和其他网站上找到的一些例子,这就是我所拥有的,它不会用xml"命中"服务器.我可以在浏览器中查看xml.

$(document).ready(function(){    
   $.ajax({
        type: 'GET',
        dataType: 'jsonp',                
        url: 'http://192.168.0.106:8111/getconfiguration?',
        success: function (xml) 
        { //do stuff with received xml 
        }});    
Run Code Online (Sandbox Code Playgroud)

有什么建议?请记住,我是关于JS/JQuery的新手; o)

xml xss jsonp cross-domain

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

log4net无法在Windows服务中运行

我有一个控制台应用程序,我正在转换为Windows服务.作为控制台应用程序,我的log4net日志记录工作正常.但是将它转换为Windows服务,我的log4net日志记录已停止工作.

我已将此添加到服务项目中的assemblyInfo.cs中:

[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)] 
Run Code Online (Sandbox Code Playgroud)

这是我的onstart和onstop服务类:

private static log4net.ILog _log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        private Builder _builder;

        public YCSWebServerService()
        {
            InitializeComponent();
            _builder = new Builder();
        }

        protected override void OnStart(string[] args)
        {
            _log.Info("YCSWebServerService started");
            _builder.Start();
        }

        protected override void OnStop()
        {
            _log.Info("YCSWebServerService stopped");
            _builder.Stop();
        }
Run Code Online (Sandbox Code Playgroud)

我有一个"特定的"log4net配置文件添加到我的服务项目:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>

  <log4net>
    <root>
      <level value="ALL" />
      <appender-ref ref="EventLogAppender" />
    </root>
    <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
      <threshold value="DEBUG" />
      <applicationName value="Lantic YCS WebServer" /> …
Run Code Online (Sandbox Code Playgroud)

c# logging windows-services

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

如何在c#中编写这个正则表达式

我有一个像这样的字符串:

N:string of unknown length\r\n
Run Code Online (Sandbox Code Playgroud)

我希望将"未知长度的字符串"读入变量.N:始终是字符串的开头,\ r \n始终是字符串的结尾,我需要介于两者之间.

我的C#

String pattern ="help needed"
string result = Regex.IsMatch(pattern,myString).ToString();
Run Code Online (Sandbox Code Playgroud)

编辑!!对不起,但我发现我不太清楚我想要什么.

我正在寻找N:string of unknown length\r\n的字符串是一个更大字符串的子字符串.Fx Bla bla\r\n bla bla N:string of unknown length\r\n more bla bla N:string of unknown length\r\n 它只会发生一次.

c# regex

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

标签 统计

c# ×2

cross-domain ×1

javascript ×1

jsonp ×1

logging ×1

qr-code ×1

regex ×1

windows-services ×1

xml ×1

xss ×1