将字符串添加到文本框中的代码中 [英] Add string in to a code from textbox

查看:47
本文介绍了将字符串添加到文本框中的代码中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我从文本框中添加字符串,c#可以做,那么字符串将写入代码。



例如:

隐藏 复制代码

mylist.Add(新的字符串[] { });



当i型 从文本框香蕉 和我clik保存它将自动添加或更新代码。

它变成这样。

 

隐藏 复制代码

mylist.Add(新的String [] { 香蕉});





谢谢你好吗。



我尝试了什么:



我尝试过mylist.add(新的字符串[] { };

解决方案
尝试:

<预郎= C#> myList中。添加(myTextBox.Text);


Does c# can do if i adding string from textbox then the string will be write in a code.

example:
Hide   Copy Code
mylist.Add(new string[] {""});

when i type "banana" from textbox and i clik save it will add or update automaticly from the code.
it become like this.
 
Hide   Copy Code
mylist.Add(new string[] {"banana"});


thank you somuch.

What I have tried:

I tried with mylist.add(new string[]{""};

解决方案

Try:

myList.Add(myTextBox.Text);


这篇关于将字符串添加到文本框中的代码中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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