if语句来控制后面代码中的输入文本 [英] if statement to control input text in code behind

查看:99
本文介绍了if语句来控制后面代码中的输入文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我需要创建if语句来控制输入文本;当用户键入蓝色时,请从后面的代码中为下一个用户发送消息,以通知他或她已经键入了蓝色。
有什么解决方案吗?

I need to create if statement to control input text for example; when user type blue, send message from code behind for next user in order to notify him or her blue is already typed. Is there any solution:

        if (user.Text == "blue")
        {



        }


推荐答案

您可以将这样的值放在静态变量或应用程序级对象中,这样该值将在整个用户中持久保存,并且可以从静态检查您的下一个用户或应用程序级别的变量。

You can put such value in Static variable or Application level object, so that value will be persisted across the user and you can check for your next user from static or application level variable.

这篇关于if语句来控制后面代码中的输入文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆