小编Art*_*lev的帖子

如何在C#正则表达式中将数字与空格和新行匹配?

我有一个注册表,我想在C#中验证电话号码,我的inputText中只接受带有空格或换行符的数字,我该如何创建模式?我使用[^\d\s+$]但它不能正常工作?

c# regex

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

在C#中以CSV形式转换单个数据行

如何只使用少量C#命令将单个数据行(数据表)转换为类似CSV的字符串.换句话说,变成像"value_1; value_2; ...; value_n"这样的字符串

.net c# csv

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

带有display:none的嵌套HTML元素在IE8中不起作用

我正在使用jQuery淡入<article>包含<section>元素的元素.

外元件是display:none,position:fixed,和z-index:5.里面的元素是position:absolute.

基本上,文章给出了一个框架,内部部分保存内容并具有滚动条.

我正在淡出外部元素并期待内部效仿.

在IE9 +,FF和Chrome中,它按预期工作.

在IE8中 - 它没有.外部文章根本不会淡入 - 保持不可见,内部部分相对于浏览器框架定位并始终可见.页面上的其他元素都是倾斜的,页面大部分都不起作用.

代码示例:

article
{
  display: none;
  position: fixed;
  z-index: 5;
}

section
{
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  left: 10px;
  overflow: auto;
}
Run Code Online (Sandbox Code Playgroud)

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
  </head>
  <body>
    <article id="contentFrame">
      <section id="content">
        Lorem Ipsum
      </section>
    </article>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

$("#contentFrame").fadeIn(2000);
Run Code Online (Sandbox Code Playgroud)

javascript css jquery html5 internet-explorer

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

如何编写一个javascript函数来检查我的文本框是否包含特殊字符?

我想使用java脚本检查我的文本框是否包含特殊字符.为此,我使用以下代码

function CheckUserId() {
    var txt = document.getElementById('<%=TextBox1.ClientID%>').value;
    var regexp = "/^[a-zA-Z0-9]+$/";
    if (regexp.match(txt)) {
        alert("No special character ");
        return true;
    }
    else {
        alert("Special character");
        return false;
    }
    }
Run Code Online (Sandbox Code Playgroud)

我在textbox onblur上调用这个java脚本函数.TextBox代码如下

  <asp:TextBox ID="TextBox1" runat="server" onblur="CheckUserId()" ></asp:TextBox>
Run Code Online (Sandbox Code Playgroud)

但它始终显示警告信息"特殊字符".我的代码有什么问题?请帮我

javascript regex asp.net

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

将类构造函数重载INSIDE在同一个类的另一个重载中

嘿,所以我正在使用Windows GetTickCount()和STL进行秒表课程,但遇到了一个问题,即在将Stopwatch(int DecNumb)构造函数实现到重载Stopwatch(int DecNumb,char command [])时在后一个构造函数中未正确设置"准确性"数据类型.

(它似乎返回到unsigned long int 560345的前值或者其他东西......)

这是我用来测试它的class和main()命令:

class Stopwatch
    {
    protected:
        int               accuracy;
        unsigned long int initial_ilu;
        unsigned long int current_ilu;
        long float        output_fl;
       vector<long float> times;

    public:
        Stopwatch(int DecNumb) { // so accuracy*10 isn't 0
                                    accuracy = 1;
                                for(;DecNumb>0;DecNumb--) // the Tick count will
                                accuracy = accuracy*10;}; // diveded by accuracy (each 0 in this number moves the decimal over once)
        Stopwatch(int aDecNumb, char command[]) {Stopwatch::Stopwatch(aDecNumb);
                                                 if(command = "start") Stopwatch::Start();}; 
        void Start(){initial_ilu = GetTickCount()/*/accuracy*/;};
        long …
Run Code Online (Sandbox Code Playgroud)

c++ time constructor stopwatch

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

始终包含当前变量值的列表.C#

因此,我需要一个列表(或类似的数据结构),一旦添加它,它总是保存给定变量的当前值.这是当前发生的事情(更简单/伪代码):

intValue = 5;
intList.Add(intValue);

Print intList[0].toString();
Run Code Online (Sandbox Code Playgroud)

打印"5"

intValue++;
Print intList[0].toString();
Run Code Online (Sandbox Code Playgroud)

当我想要打印intValue的新值"6"时仍然打印"5".

基本上列表需要存储对intValue的引用(我认为这是正确的术语),而不是它的实际值.谢谢你的时间.

c# list mutable

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

标签 统计

c# ×3

javascript ×2

regex ×2

.net ×1

asp.net ×1

c++ ×1

constructor ×1

css ×1

csv ×1

html5 ×1

internet-explorer ×1

jquery ×1

list ×1

mutable ×1

stopwatch ×1

time ×1