取消注释代码编程 [英] Uncomment code programmatically

查看:99
本文介绍了取消注释代码编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么可以注释掉一些评论编程?大概是这样
想: -

How can I comment out some comment programmatically? Think of something like this:-

void releaseA()
{
   //ToDo:
}
//string A = "Test";
releaseA();
textbox1.Text = A;



我怎样才能做到这一点,并实现方法 releaseA 注释掉 //字符串A =测试;
我搜查,但仍无法找到任何东西。

How can I achieve this and implement method releaseA to comment out //string A = "Test"; I searched but still can't find anything.

推荐答案

我觉得你真的想做的事是这样的:

I think what you really want to do is this:

string a = "";

if (condition)
    a = "Test";

textBox1.Text = a;



因此,对于你一个复选框和一个文本框的例子:

So for your example of a checkbox and a text box:

string text = "";

if (checkBox.Checked)
    text = inputTextBox.Text;

resultTextBox.Text = text;

这篇关于取消注释代码编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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