我试图使用批处理文件编写VPN拨号器/断路器,但我卡住了.经过一番调查后,我发现%
密码的存在并不好.
这是代码
@echo OFF
SET SWITCHPARSE1=%1
SET SWITCHPARSE2=%2
REM echo %SWITCHPARSE1%
SHIFT
SHIFT
IF "SWITCHPARSE1" == "" goto Usage
IF "SWITCHPARSE1" == "/?" goto Usage
IF "SWITCHPARSE2" == "" goto Usage
IF "SWITCHPARSE2" == "/?" goto Usage
IF "%SWITCHPARSE1%" == "sl" (
IF "%SWITCHPARSE2%" == "conn" (
echo "inside sl conn"
rasdial sl employee1 K%%Pxev3=)g:{#Swc9
goto end
) ELSE IF "%SWITCHPARSE2%" == "disconn" (
rasdial sl /disconnect
goto end
) ELSE (
goto Usage
)
) ELSE IF …
Run Code Online (Sandbox Code Playgroud) 嗨,我想采取列表集合并生成一个单独的csv行.所以拿这个;
List<string> MakeStrings()
{
List<string> results = new List<string>();
results.add("Bob");
results.add("Nancy");
results.add("Joe");
results.add("Jack");
return results;
}
string ContactStringsTogether(List<string> parts)
{
StringBuilder sb = new StringBuilder();
foreach (string part in parts)
{
if (sb.Length > 0)
sb.Append(", ");
sb.Append(part);
}
return sb.ToString();
}
Run Code Online (Sandbox Code Playgroud)
这将返回"Bob,Nancy,Joe,Jack"
寻求LINQ的帮助,在单个语句中执行此操作.谢谢!
每当我尝试运行visual studio 2005时,我都会收到这个恼人的消息(即使使用"以管理员身份运行"也会发出相同的消息).我有VS 2005 Professional安装了所有最新的服务包,包括vs2005 SP1和vs 2005的Vista更新.
我是我机器上管理员组的成员.我还有这个问题.
网上的一些内容表明,在兼容模式下运行程序可以解决问题.其他人也建议永远关闭消息.
好吧,我的问题是如何关闭此警告,即使我是管理员组的一部分,这似乎也会让我感到困扰.即使我是管理员,甚至使用"Run as adminsitrator",Visual Studio也不会以管理员模式运行.
如果在Windows 7上以Visual Studio作为普通用户(用户不是管理员/管理员组的一部分)启动Visual Studio,那么有人可以突出显示Visual Studio的哪些功能.
我想为某些键存储null,HttpRuntime.Cache
因为我不想再次转到数据库以找到该键没有条目.
所以第一次,它进入数据库并填充缓存.目的是使用缓存数据而不是进行数据库调用来提供以下调用.
这是我使用以下代码:
Info info = null;
if (HttpRuntime.Cache["Info_" + id.ToString() + "_" + quantity.ToString()] != null)
info = HttpRuntime.Cache["Info_" + id.ToString() + "_" + quantity.ToString()] as Info;
if (info == null)
{
info = (from dd in dc.Infos
where dd.id == id && dd.active == true && dd.quantitytooffset == quantity
select dd).SingleOrDefault();
HttpRuntime.Cache.Add("Info_" + id.ToString() + "_" + quantity.ToString(), info, null, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.High, null);
}
Run Code Online (Sandbox Code Playgroud)
最后一行代码即HttpRuntime.Cache.Add抛出一个System.ArgumentNullException:Value不能为null.
任何想法是否可行或我需要使用其他数据结构来存储空值并在以后查找?