我试着用这个源代码提取wan_ip的值(IP地址):怎么回事?!我确定RegEx模式是正确的.
String input = @"var product_pic_fn=;var firmware_ver='20.02.024';var wan_ip='92.75.120.206';if (parent.location.href != window.location.href)";
Regex ip = new Regex(@"[\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b");
string[] result = ip.Split(input);
foreach (string bla in result)
{
Console.WriteLine(bla);
}
Console.Read();
Run Code Online (Sandbox Code Playgroud) 有谁知道如何将多个参数传递给Thread.Start例程?
我想扩展类,但C#Thread类是密封的.
以下是我认为代码的样子:
...
Thread standardTCPServerThread = new Thread(startSocketServerAsThread);
standardServerThread.Start( orchestrator, initializeMemberBalance, arg, 60000);
...
}
static void startSocketServerAsThread(ServiceOrchestrator orchestrator, List<int> memberBalances, string arg, int port)
{
startSocketServer(orchestrator, memberBalances, arg, port);
}
Run Code Online (Sandbox Code Playgroud)
顺便说一下,我用不同的协调器,天平和端口启动了许多线程.请考虑线程安全.
我正在使用以下代码:
INSERT INTO tForeignLanguage ([Name]) VALUES ('????')
Run Code Online (Sandbox Code Playgroud)
这个值插入就像这个'????'
如何从sql management studio查询窗口插入unicode文本?
我加入了
SELECT * FROM Y
INNER JOIN X ON ISNULL(X.QID, 0) = ISNULL(y.QID, 0)
Run Code Online (Sandbox Code Playgroud)
Isnull在像这样的加入使它变得缓慢.这就像有条件的加入.有什么工作可以解决这个问题吗?我有很多记录,其中QID是Null
任何人都有一个解决方案,不需要修改数据
我有一个对象,其属性的计算成本很高,因此它们仅在首次访问时计算,然后进行缓存.
private List<Note> notes;
public List<Note> Notes
{
get
{
if (this.notes == null)
{
this.notes = CalcNotes();
}
return this.notes;
}
}
Run Code Online (Sandbox Code Playgroud)
我想知道,有更好的方法吗?是否有可能在C#中创建一个Cached属性或类似的东西?
我正在使用ASP.NET MVC,我需要设置一个会话变量Application_BeginRequest.问题是,此时对象HttpContext.Current.Session始终是null.
protected void Application_BeginRequest(Object sender, EventArgs e)
{
if (HttpContext.Current.Session != null)
{
//this code is never executed, current session is always null
HttpContext.Current.Session.Add("__MySessionVariable", new object());
}
}
Run Code Online (Sandbox Code Playgroud) 我已尝试过网上的所有建议,但无济于事.
我根据这些说明编写了一个控制台应用程序:http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontenttypecollection.delete.aspx
"Usages.Count"是= 0.但是,当它试图删除内容类型时,我得到一个异常:
"内容类型正在使用中."
这是一个全新的(开发)安装.我在SP Designer中创建了一个测试站点,创建了一个内容类型,然后创建了一个列表.然后,我删除了列表,将其从回收站中删除,并尝试删除内容类型......呃.
我正在社交网络上工作,我的一个程序返回一个VARCHAR输出.所以这就是我写的:
SqlParameter job1 = cmd2.Parameters.Add("@job", SqlDbType.VarChar);
job1.Direction = ParameterDirection.Output;
Run Code Online (Sandbox Code Playgroud)
但是出现此错误:
String [1]:Size属性的大小无效.
我已经使用Windows安装程序卸载了VS11,并删除了我能找到的与它相关的每个注册表项,但是当我尝试重新安装它时它仍会弹出:

我无法点击"..."或编辑路径.右键单击也不执行任何操作.
我需要销毁什么才能更改安装目录?
官方发布时仍在发生:

是否可以将文件夹(普通Html文件)的内容部署到远程IIS6/7服务器上的特定Web应用程序?
以下命令不会出错,但也不会将任何文件发布到远程服务器:
msdeploy.exe -verb:sync -source:dirPath="c:\myHtmlFiles" -dest:auto,ComputerName="http://deploy.mycompany.co.uk/msdeploy?site=TestSite",includeAcls="false",username="administrator",password="myPassword" -enableRule:DoNotDeleteRule -disableLink:AppPoolExtension -disableLink:ContentExtension -allowUntrusted
Run Code Online (Sandbox Code Playgroud)
注意:
c# ×4
.net ×2
asp.net ×2
sql ×2
sql-server ×2
asp.net-mvc ×1
caching ×1
content-type ×1
global-asax ×1
join ×1
msdeploy ×1
null ×1
parameters ×1
properties ×1
regex ×1
sqlparameter ×1
unicode ×1
webdeploy ×1