我有一个40个文件的目录,名称从0到39(例如),我试图获取其名称中最大数字的文件(这意味着我需要得到"39")我试图对目录进行排序..我尝试过使用以下主题:
在C#中对Directory.GetFiles的结果进行排序
没有什么对我有用..我尝试了每种方法 - 使用Linq和其他...我不知道为什么..
我得到以下排序结果(见下图):

谢谢您的帮助,
Din Bracha.
在开始我的应用程序之前(在表单加载上)我想检查并确保在机器上安装.NET框架(3.5或更高版本) - 如果不是我想提示用户下载并安装它(带有INTERNET的简单MessageBox)链接到Microsoft WebPage会是最好的想法吗?)所以,这实际上需要两个问题......
a)如何安装.NET FrameWork 3.5或更高版本,如何确定?(我不信任或者只想找C:\ Program Files\Microsoft.NET文件夹,看起来容易出错吗?)看到这是非常关键的,必须有一个很好的方法在C#中确定什么版本用户在他的机器上运行的.NET?我只是不知道如何..
b)如何在MessageBox中粘贴INTERNET LINK(超链接?)?因此,如果用户没有安装.NET框架(1.1或2.0),我可以让他们只需点击链接即可下载吗?
任何帮助/提示将不胜感激.
谢谢,丁
嘿伙计们,首先我必须说,这可能看起来很多代码,但它很容易阅读.我试图绑定一些东西,我得到这个结果:
http://img694.imageshack.us/f/28475988.jpg/
正如您所看到的那样,数字,描述,行和列似乎是重复的.
在我的主表单设计师我有:
<Window x:Class="Visual_Command_Line.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Visual_Command_Line"
xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit"
Title="Visual Command Line" MinHeight="750" MinWidth="900" Loaded="Window_Loaded" Icon="/Visual_Command_Line;component/Resources/icon16x16.ico" WindowStartupLocation="CenterScreen" WindowState="Maximized" Closing="Window_Closing">
<Window.Resources>
<local:ErrorListCollection x:Key="ErrorList" />
</Window.Resources>
<dg:DataGrid Name="DataGrid_ErrorList" IsReadOnly="True" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeRows="False" CanUserSortColumns="False" ItemsSource="{Binding Source={StaticResource ErrorList}}">
<dg:DataGrid.Columns>
<dg:DataGridTextColumn Binding="{Binding Path=GetNumber}" Header="" />
<dg:DataGridTextColumn Binding="{Binding Path=GetDescription}" Header="Description" Width="10*" />
<dg:DataGridTextColumn Binding="{Binding Path=GetLine}" Header="Line" Width="*" />
<dg:DataGridTextColumn Binding="{Binding Path=GetColumn}" Header="Column" Width="*" />
</dg:DataGrid.Columns>
</dg:DataGrid>
</Grid>
Run Code Online (Sandbox Code Playgroud)
当主表单加载我做:
((ErrorListCollection)this.FindResource("ErrorList")).RenewErrorList(((TabDocument)dockManager.ActiveDocument).currentAnalizedLine);
Run Code Online (Sandbox Code Playgroud)
这是ErrorListCollection类:
class ErrorListCollection : ObservableCollection<DebugError>
{
public ErrorListCollection()
{
}
public void RenewErrorList(AnalizedLine al) //also all …Run Code Online (Sandbox Code Playgroud) 我想知道以下哪些代码渲染速度更快,效率更高:
这个 -
body{background:#ddd;font-family:verdana;font-size:12px;color:#808080;}
a{color:#808080;outline:0;text-decoration:none;}
input{margin:0;padding:0;font-family:verdana;color:#808080;}
ul{padding:0;margin:0;}
Run Code Online (Sandbox Code Playgroud)
或这个 -
body,input{font-family:verdana}
body,input,a{color:#808080;}
body{background:#ddd;;font-size:12px;}
a{outline:0;text-decoration:none;}
input,ul{margin:0;padding:0;}
Run Code Online (Sandbox Code Playgroud) 最近我问过这个问题: 想了解Animate功能(计算和步进) ,我得到了答案.
我试图删除不必要的jQuery代码,只留下jQuery动画函数.
如果有人能为我提供具有其他技术的jQuery动画功能 - 我将非常感激.
我试图以编程方式将一个SubMenu添加到我的MenuItem,我该怎么做?到目前为止这是我的代码:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(Menu.NONE, R.id.extra_options, Menu.NONE, "Menu1")
.setIcon(Config.chooseActionBarIcon(
MainActivity.this, "ic_actionbar_font"))
.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
SubMenu themeMenu = menu.findItem(R.id.extra_options).getSubMenu();
themeMenu.clear();
themeMenu.add(0, R.id.theme_auto, Menu.NONE, "Automatic");
themeMenu.add(0, R.id.theme_day, Menu.NONE, "Default");
themeMenu.add(0, R.id.theme_night, Menu.NONE, "Night");
themeMenu.add(0, R.id.theme_batsave, Menu.NONE, "Battery Saving");
return super.onCreateOptionsMenu(menu);
}
Run Code Online (Sandbox Code Playgroud)
R.id.extra_options是在"ids.xml"资源文件中定义的ID;
<item type="id" name="extra_options" />
Run Code Online (Sandbox Code Playgroud)
使用getSubMenu()获取SubMenu似乎没问题,但是当我尝试将项添加到SubMenu时,我收到错误"NullPointerException"
任何人都知道代码有什么问题?
这是速度问题.我有以下代码:
if (MyXMLReader.SearchForValue(command, new List<string>() { "/Command/Descriptions/Description/System" }, ((TabDocument)dockManager.ActiveDocument).version))
{
txtBox_desc.Text = MyXMLReader.GetValue(command, "/Command/Descriptions/Description[" + MyXMLReader.SearchForValue_Int(command, new List<string>() { "/Command/Descriptions/Description/System" }, ((TabDocument)dockManager.ActiveDocument).version) + "]/Content");
}
if (MyXMLReader.SearchForValue(command, new List<string>() { "/Command/Uses/Use/System" }, ((TabDocument)dockManager.ActiveDocument).version))
{
txtBox_use.Text = MyXMLReader.GetValue(command, "/Command/Uses/Use[" + MyXMLReader.SearchForValue_Int(command, new List<string>() { "/Command/Uses/Use/System" }, ((TabDocument)dockManager.ActiveDocument).version) + "]/Content");
}
if (MyXMLReader.SearchForValue(command, new List<string>() { "/Command/Notes/Note/System" }, ((TabDocument)dockManager.ActiveDocument).version))
{
txtBox_notes.Text = MyXMLReader.GetValue(command, "/Command/Notes/Note[" + MyXMLReader.SearchForValue_Int(command, new List<string>() { "/Command/Notes/Note/System" }, ((TabDocument)dockManager.ActiveDocument).version) + "]/Content");
}
Run Code Online (Sandbox Code Playgroud)
我应该创建一个新string变量来保存
((TabDocument)dockManager.ActiveDocument).version?
Run Code Online (Sandbox Code Playgroud)
这会有更快的速度和响应能力吗?这会是坏事还是好事?
在新的Angular 2中,我们引入了TypeScript,它主要提供可选的静态类型,类和接口。
用TypeScript编写后,我们需要将代码编译为JavaScript才能运行程序
问题是我应该将带有打字稿文件的已编译javascript推送到服务器,还是应该忽略javascript文件.gitignore并直接npm start在将要编译文件的服务器上运行?
我试图使窗口的宽度和高度为auto,这意味着它将具有所有子控件的宽度和高度组合:
我的代码:
<Window x:Class="Read_360.ToastPopup"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="ToastPopup" Width="Auto" Height="68">
<Window.Resources>
<ControlTemplate x:Key="MyErrorMessage"
TargetType="{x:Type Label}">
<StackPanel Orientation="Horizontal"
Name="ErrorMessage" Width="Auto" Height="Auto">
<Border CornerRadius="4" Width="Auto"
BorderThickness="0"
VerticalAlignment="Center"
Margin="4,0"
Background="#FF404040"
BorderBrush="Transparent">
<Label Foreground="White"
VerticalAlignment="Center"
Padding="4,2"
Margin="4"
FontWeight="Bold" FontSize="15"
Name="Part1" Width="Auto" Height="Auto"
Visibility="Visible" HorizontalAlignment="Center" Content="{Binding Message}" />
</Border>
</StackPanel>
</ControlTemplate>
</Window.Resources>
<StackPanel Orientation="Vertical">
<Label Template="{StaticResource MyErrorMessage}" Name="Label1" Width="Auto" Height="Auto"></Label>
</StackPanel>
Run Code Online (Sandbox Code Playgroud)
我需要宽度和高度与ControlTemplate内的Label相同
提前致谢,
声浪.