问题列表 - 第17246页

在运行时获取当前的.NET CLR版本?

如何在正在运行的.NET程序中获取当前的CLR Runtime版本?

.net clr

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

打开文件时vim命令行完成

如何使VIM始终在命令模式下自动完成文件名?当我键入例如":cd/ww [Tab]"时它工作正常,但如果我想打开一个文件并输入":o/ww [Tab]",它会插入"^ I"字符而不是完成.

vim

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

C#非元音词

我想要一个需要返回非元音词的扩展方法.我设计了

 public static IEnumerable<T> NonVowelWords<T>(this IEnumerable<T> word)
    {
        return word.Any(w => w.Contains("aeiou"));
    }
Run Code Online (Sandbox Code Playgroud)

我收到错误,因为"T"不包含extanesion方法"Contains".

c# extension-methods

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

System.Drawing:GDI +未正确初始化(内部GDI +错误)

ASP.NET Web站点随机引发此System.Drawing-error:

System.Runtime.InteropServices.ExternalException:System.Drawing.Bitmap..ctor(Stream stream)System.Drawing.ToolboxBitmapAttribute..cctor()

Exception information: 
    Exception type: TypeInitializationException 
    Exception message: The type initializer for 'System.Drawing.ToolboxBitmapAttribute' threw an exception. 

Stack trace:    at System.Reflection.CustomAttribute._CreateCaObject(Void* pModule, Void* pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
   at System.Reflection.CustomAttribute.CreateCaObject(Module module, RuntimeMethodHandle ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
   at System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
   at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
   at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectGetAttributes(Type type)
   at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetAttributes()
   at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes()
   at System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType)
   at System.Web.UI.ThemeableAttribute.IsTypeThemeable(Type …
Run Code Online (Sandbox Code Playgroud)

asp.net iis system.drawing gdi+

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

如何使用Ruby on Rails解析JSON?

我正在寻找一种简单的方法来解析JSON,提取一个值并将其写入Rails中的数据库.

特别是我正在寻找的是一种shortUrl从bit.ly API返回的JSON中提取的方法:

{
  "errorCode": 0,
  "errorMessage": "",
  "results":
  {
    "http://www.foo.com":
    {
       "hash": "e5TEd",
       "shortKeywordUrl": "",
       "shortUrl": "http://bit.ly/1a0p8G",
       "userHash": "1a0p8G"
    }
  },
  "statusCode": "OK"
}
Run Code Online (Sandbox Code Playgroud)

然后使用shortUrl并将其写入与long URL关联的ActiveRecord对象.

这是我完全可以在概念中思考的事情之一,当我坐下来执行时,我意识到我有很多需要学习的东西.

ruby json ruby-on-rails

310
推荐指数
8
解决办法
28万
查看次数

如何在SaveFileDialog中的默认FileName中设置长字符串(> 260)?

我正在使用SaveFileDialog并且必须在FileName中设置长字符串(longFileName).字符串longFileName在运行时已知.

如果我订

saveFileDialog.FileName = longFileName ;
Run Code Online (Sandbox Code Playgroud)

然后我明白了System.IO.PathTooLongException.

我该怎么做?

.net c# windows long-filenames savefiledialog

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

如何防止DIV标记开始新行?

我想将一行文本输出到包含标记的浏览器.渲染时,DIV会显示一条新行.如何在同一行的div标签中包含内容 - 这是我的代码.

<?php 
  echo("<a href=\"pagea.php?id=$id\">Page A</a>") 
?>
<div id="contentInfo_new">
  <script type="text/javascript" src="getData.php?id=<?php echo($id); ?>"></script>
</div>
Run Code Online (Sandbox Code Playgroud)

我试着在这里整理一下.如何在一行显示此显示?

html css

83
推荐指数
5
解决办法
14万
查看次数

Xcode 3.2调试:看到字符串中的什么?

有没有人知道我需要添加到摘要字段的显示格式化程序,以显示NSArray中包含的NSString对象的内容?我已经为NSArray添加了以下格式化程序,以便显示其内容......

"{(int)[$VAR count]} objects {(NSString *)[(NSArray *)$VAR description]}:s"
Run Code Online (Sandbox Code Playgroud)

替代文字

我真的希望(0-6标记为红色)在"摘要"中显示如下:

0 =星期一

1 =星期二

2 =周三

3 =周四......等

加里

xcode

8
推荐指数
1
解决办法
1003
查看次数

编码cp1252

当我在Java中尝试以下内容时:

System.out.println(System.getProperty("file.encoding"));

我得到cp1252编码.

有没有办法知道这个价值来自哪里?(像环境变量或其他东西)

我想在Windows XP上使用systeminfo之类的命令在命令提示符下打印编码值.

java windows encoding cp1252

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

模拟ShowDialog功能

我正在编写一个应用程序(c#+ wpf),其中所有模态样式对话框都实现为UserControl覆盖main的半透明网格Window.这意味着只有一个Window,它保持了所有公司应用程序的外观和感觉.

要显示a MessageBox,语法如下:

CustomMessageBox b = new CustomMessageBox("hello world");
c.DialogClosed += ()=>
{
   // the rest of the function
}
// this raises an event listened for by the main window view model,
// displaying the message box and greying out the rest of the program.
base.ShowMessageBox(b); 
Run Code Online (Sandbox Code Playgroud)

正如您所看到的,不仅执行流程实际上已经反转,而且与经典的.NET版本相比,它的冗长程度如此:

MessageBox.Show("hello world");
// the rest of the function
Run Code Online (Sandbox Code Playgroud)

我真正想要的是一种不会返回的方法,base.ShowMessageBox直到它引发了对话框关闭事件,但是我无法看到如何在不挂起GUI线程的情况下等待这一点,从而阻止用户点击OK.我知道我可以将一个委托函数作为函数的参数来ShowMessageBox阻止执行的反转,但仍会导致一些疯狂的语法/缩进.

我错过了一些明显的东西,还是有标准的方法来做到这一点?

c# wpf events dialog messagebox

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