小编Sri*_*ava的帖子

什么是CAPTCHA用于安全目的?

就安全问题而言,CAPTCHA做了什么?很多网站的注册表都有这个领域,但它是如何运作的?

asp.net security asp.net-mvc

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

必填字段验证器不起作用

我使用了必需的字段验证器,后跟一个正则表达式验证器,但是必需的字段验证器不工作.....

<asp:TextBox ID="txtSummary" runat="server" TextMode="MultiLine" Width="700px"
    CssClass="txtStyle" Font-Names="Arial" MaxLength="1000" 
    ValidationGroup="Valtxt" TabIndex="2" Rows="4">
</asp:TextBox>

<asp:RegularExpressionValidator ID="regValSummary" runat="server"
    ControlToValidate="txtSummary" Display="Dynamic"
    ValidationExpression="[^&lt;&gt;&amp;#!]*" ValidationGroup="Valtxt">
        Invalid characters(&lt;&gt;&amp;#!) are not allowed
</asp:RegularExpressionValidator>

<asp:RequiredFieldValidator ID="reqvalSummary" runat="server"
    ControlToValidate="txtSummary" ErrorMessage="Summary is required"
    ValidationGroup="Valtxt" Display="Dynamic">
</asp:RequiredFieldValidator>
Run Code Online (Sandbox Code Playgroud)

任何人都可以看到问题???

asp.net validation requiredfieldvalidator

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

查询以大写形式选择没有其名称的所有表名

任何人都可以提供一个查询来选择数据库中没有大写名称的所有表的列表吗?

sql sql-server

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

gridview中的新行

我有一个网页,我让用户输入内容,即使他们经常在文本框中更改行,gridview从数据库中检索时也不显示任何新行.

asp.net

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

消息框未显示消息

我编写了一组函数来验证表单中的文本框,以满足他们所需的字段需求

private void ValidateForm()

        {
        //Initialise the variables for validation check and call the related functions
        bool bisValidhost = ValidateHost();
        bool bisValidPassword = ValidatePassword();
        bool bisUsername = ValidateUsername();

        //If any of the entries is missing then show error message
        if(bisValidhost && bisValidPassword && bisUsername == false)
            {
            MessageBox.Show("This is not a Valid Entry!");                
            }         
        }


    /// <summary>
    /// This function validate the Required field need of txtHost.
    /// </summary>
    /// <returns></returns>
    private bool ValidateHost()
        {
        ErrorProvider errorProvider = new ErrorProvider(); …
Run Code Online (Sandbox Code Playgroud)

c# visual-studio winforms

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

string.compare和字符串进行比较

我有这样的代码

private void btnStartAnalysis_Click(object sender, EventArgs e)

            {

        //Checks for the selectedItem in the cmbOpearions dropdown and make call to appropriate functions.
        if((string) (cmbOperations.SelectedItem) == "PrimaryKeyTables")
            {
            //This is the function call for the primary key checking in DB
            GetPrimaryKeyTable();
            }

        //Checks for the selectedItem in the cmbOpearions dropdown and make call to appropriate functions.
        if((string) (cmbOperations.SelectedItem) == "NonPrimaryKeyTables")
            {
            //This is the function call for the nonPrimary key checking in DB
            GetNonPrimaryKeyTables();
            }

        //Checks for the selectedItem in the …
Run Code Online (Sandbox Code Playgroud)

c# visual-studio winforms

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

string.empty和string.isnullorempty

我有一个这样的函数,它检查字段是否为空或什么,如果为空,然后在文本框旁边获取setError图标.

      private bool ValidateHost()
      {
        ErrorProvider errorProvider = new ErrorProvider();
        bool isValid = true;

        //If the txtHost is empty, show a message to user            
        if(txtHost.Text == string.Empty)
            {
            errorProvider.SetError(txtHost, "Please enter the host address");
            isValid = false;
            }
        else
            errorProvider.SetError(txtHost, string.Empty);
        return isValid;
      }
Run Code Online (Sandbox Code Playgroud)

但是当我尝试使用字符串时,isnullorempty然后我没有得到seterror图标..你们可以告诉我在这种情况下使用string.isnullorempty的正确方法是什么..

c# visual-studio winforms

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

将硬编码值删除到app.config文件

我开发了一个表单,从用户获取用户ID和密码,并显示本地服务器中可用的数据库列表.现在我已经用硬编码格式完成了...像这样

public void BindDBDropDown()
{
    //Create the connection object
    SqlConnection sConnection = new SqlConnection(
        ConfigurationSettings.AppSettings["ConnectionString"]);

    //To Open the connection.
    sConnection.Open();

    //Query to select the list of databases.
    string selectDatabaseNames =
        @"SELECT NAME FROM MASTER..SYSDATABASES";

    //Create the command object
    SqlCommand sCommand = 
        new SqlCommand(selectDatabaseNames, sConnection);

    try
    {
        //Create the data set 
        DataSet sDataset = new DataSet("master..sysdatabases");

        //Create the dataadapter object
        SqlDataAdapter sDataAdapter = 
            new SqlDataAdapter(selectDatabaseNames, sConnection);
        sDataAdapter.TableMappings.Add("Table", 
            "master..sysdatabases");

        //Fill the dataset
        sDataAdapter.Fill(sDataset);

        //Bind the database names in combobox
        DataViewManager dsv = …
Run Code Online (Sandbox Code Playgroud)

c# visual-studio winforms

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

未将对象引用设置为对象的实例

我有这样的功能

public void GetTablesWithUpperCaseName()
{
   SqlConnectionStringBuilder objConnectionString = new SqlConnectionStringBuilder();
   objConnectionString.DataSource = txtHost.Text;
   objConnectionString.UserID = txtUsername.Text;
   objConnectionString.Password = txtPassword.Text;
   objConnectionString.InitialCatalog = Convert.ToString(cmbDatabases.SelectedValue);

   SqlConnection sConnection = new SqlConnection(objConnectionString.ConnectionString);

   //To Open the connection.
   sConnection.Open();

   //Query to select table_names that have their names in uppercase letters.
   string selectTablesWithUppercaseName = @"SELECT 
                                              NAME
                                            FROM 
                                              sysobjects 
                                            WHERE 
                                              UPPER(name) COLLATE Latin1_General_BIN = name COLLATE Latin1_General_BIN 
                                              AND 
                                                 OBJECTPROPERTY(ID,N'IsTable')=1
                                              AND 
                                                 OBJECTPROPERTY(ID,N'IsMSShipped')=0 ";
   //Create the command object
   SqlCommand sCommand = new SqlCommand(selectTablesWithUppercaseName, sConnection);

   try
   {
       //Create the dataset
       DataSet dsListOfTablesWithUppercaseName …
Run Code Online (Sandbox Code Playgroud)

.net c# visual-studio winforms

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

查询以获取表列表和列数

是否有任何查询,以便我可以获取表的列表,其中包含本地服务器上所选数据库的每个表中的列数.

如果有的话请转发你的想法......

c# sql t-sql sql-server sql-server-2005

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

如何使用Java中的Selenium Web Driver获取跨度的CSS类

我有这样的span元素

<span id="yui-gen56" class="ir i-doc" style="background-color: transparent;"></span>
Run Code Online (Sandbox Code Playgroud)

现在我想检索类属性值,以便它返回我ir i-doc进行验证.知道如何获取此属性值以进一步验证.

提前致谢

java automation selenium-webdriver

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