小编Tri*_*ped的帖子

正则表达式只能得到包含数字的方括号,但不在方括号内

示例字符串

 "[] [ds*[000112]] [1448472995] sample string [1448472995] ***";
Run Code Online (Sandbox Code Playgroud)

正则表达式应该匹配

 [1448472995] [1448472995]
Run Code Online (Sandbox Code Playgroud)

[000112]因为有外方括号,所以不应该匹配.

目前,我有这个正则表达式是匹配[000112] 以及

const string unixTimeStampPattern = @"\[([0-9]+)]";
Run Code Online (Sandbox Code Playgroud)

.net c# regex

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

使用javascript创建动态内容的最佳方式?

如果我创建元素并以编程方式设置元素属性是否重要,如在片段1中那样写出innerHTML,就像在片段2中一样?如何使用其中一个答案中建议的模板库?

摘录1

var link_element,
    image_element;

// create image element

image_element = $A.createElement('img');
image_element.className = "bookmark_image";
image_element.name = "bo_im";
image_element.src = bookmark_object.favicon;

// create link element

link_element = $A.createElement('a');
link_element.innerHTML = bookmark_object.title;
link_element.href = bookmark_object.url;
link_element.name = "bookmark_link";
link_element.className = "bookmark_link";
link_element.target = "_blank";

// append now
Run Code Online (Sandbox Code Playgroud)

摘录2

'<img name="bo_im class="bookmark_image" src="' + val.favicon + '">' +
'<a target="_blank" name="bookmark_link" class="bookmark_link" href = "' + val.url + '" id="' + val.id + '">' + val.title + '</a>' +

// set to …
Run Code Online (Sandbox Code Playgroud)

html javascript

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

Windows 8 XAML按钮隐藏在onHover上,我们该如何解决?

使用XAML for mettro应用程序当鼠标悬停按钮变为隐藏时,我将问题转移到按钮上,

以下是按钮代码:

<Button x:Name="btnLogin"
        Content="Login"
        Click="btnLogin_click"
        HorizontalAlignment="Left"
        Height="50"
        Margin="83,255,0,0"
        VerticalAlignment="Top"
        Width="114"
        Background="#FFE6410C" />
Run Code Online (Sandbox Code Playgroud)

xaml button windows-8 windows-runtime winrt-xaml

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

如何在Windows 8商店应用中更改组合框箭头颜色

我在Windows商店应用程序项目中有这个组合框

<ComboBox  Grid.Row="2" x:Name="ContactoSelect" Width="200" Height="50" Margin="114,10,27,510" SelectedIndex="0" Background="White" SelectionChanged="ContactoSelect_SelectionChanged">
    <x:String>Item 1</x:String>
    <x:String>Item 2</x:String>
    <x:String>Item 3</x:String>
</ComboBox>
Run Code Online (Sandbox Code Playgroud)

我想改变箭头的颜色,默认是黑色.我怎样才能做到这一点?

c# xaml combobox windows-8 windows-store-apps

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

如何使用 ObjectDataProvider 将枚举绑定到 XAML 中的 ComboBox

我正在尝试将 an 绑定Enum到 a ComboBox。我见过很多人使用ObjectDataProvider但我似乎无法访问它。我还注意到有些人在 a 中使用它Window.Resources,而不是Page.Resources但我找不到它是如何在 上使用的Page.Resources。我几个小时以来一直在寻找解决方案。

到目前为止我所拥有的:

XAML

<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Sports;assembly=Sports"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ViewModel="using:Sports.ViewModel"
xmlns:model="using:Sports.Model"
xmlns:system="using:System"


x:Class="Sports.MainPage"
mc:Ignorable="d">

<Page.DataContext>
    <ViewModel:CreateSubsVM/>
</Page.DataContext>
    <Page.Resources>

    <ObjectDataProvider></ObjectDataProvider>
    </Page.Resources>
  </Grid>
</Page>
Run Code Online (Sandbox Code Playgroud)

C#

public enum SubsAmount
{
    [Display(Description = "One Year")]
    Oneyear = 0,
    [Display(Description = "Two Years")]
    TwoYears = 1,
    [Display(Description = "Three Years")]
    ThreeYears = 2
}


public class ComboboxConverter: IValueConverter
{

    public string GetEnumValues(Enum enumObj)
    {
        DisplayAttribute attribute = …
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml objectdataprovider

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

如何获取存储过程中引用的所有列的列表?

我有许多使用 CTE、临时表、表变量和子查询的存储过程,我需要获取存储过程中使用的所有列(包括数据库、模式和表/视图)的列表。我不需要获取临时表、表变量或 CTE 中的列。我只需要在我的服务器上的数据库的表或视图中定义的引用列。

我尝试过sys.dm_sql_referenced_entitiessys.sql_expression_dependencies但它们在第一个选择查询后或在 CTE 中选择后不会返回列。

sql t-sql sql-server stored-procedures sql-server-2012

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

Do ... while()循环不能正常工作

我提示用户输入有关汽车的数据.我正在使用的Do ... while()循环第一次正常工作,然后在第一次之后无法正常工作.代码如下,我正在使用Dev-C++.谢谢你的帮助和时间.

#include <iostream>
#include<conio.h>
#include<cstring>
#include<fstream>
#include <iomanip.h>


using namespace std;

int main()
{

  char manufacturer[16], model[16], year[10], miles[10], car_cost[12];
  char response;
  ofstream OS ("usedcars.txt", ios::out);
  cout<<"for each car please enter :"<<endl;

  do
  {
    ofstream OS ("usedcars.txt", ios::app);
    cout<<"The manufacturer: ";
    cin.getline(manufacturer, 16);
    cout<<"The model: ";
    cin.getline(model, 16);
    cout<<"The year: ";
    cin.getline(year, 8);
    cout<<"The miles: ";
    cin.getline(miles, 8);
    cout<<"The cost of car $: ";
    cin.getline(car_cost, 10);

   OS << manufacturer << setw(9) << model << setw(8) << year << …
Run Code Online (Sandbox Code Playgroud)

c++ loops file do-while

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