聊天机器人,vb.net,重复输入,Visual Studio [英] chatbots,vb.net,repetitive inputs,visual studio

查看:143
本文介绍了聊天机器人,vb.net,重复输入,Visual Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,再次成为朋友;

在vb.net控制台应用程序中,我要完成以下操作;

用于指定的字符串输入,例如"greetings"
我希望控制台第一次响应"hello",如第二次,第三次和第四次(任何大于1的值),我希望控制台响应您已经说过",或者只是从随机字符串列表.这是什么代码或功能?

非常感谢您的回答..

hello again friends;

in vb.net console applications,i want to accomplish the following;

for a specified string input like "greetings"
i want the console to respond "hello" for the first time,as for the second,third and fourth times(any value that is >1) i want the console to respond "you already said that" or just pick the respond from a list of random strings. what would be the code or function for this?

Your answers are much appreciated..

推荐答案

CP通常不是这样工作的.这里最重要的目标是学习和帮助学习.
您应该自己尝试一下,遇到某些问题,例如关于代码,设计等的具体问题时,请来这里.
请查看您尝试了什么? [ 如果我们为您提供了现成的解决方案,那么它不会为您提供帮助,因为您不会从中学习任何东西.


我建议您从一种非常简单的方法开始,只检查一个字符串.
我的意思是,您将命中字符串"保存在变量中,等待用户输入,对其进行检查并计数,直到您编写为止(例如:"reset").

在这种情况下,您可以开始增加难度,将一个字符串列表保存在数组中并进行比较,或者使用一个字符串,一个重复计数器和一个标记已经说过"来制作一个很小的类
This is not how CP usually works. Most important goal here is to learn and help learning.
You are supposed to try it on your own, and come here when you got stuck with something, with a concrete question about your code, design, etc.
Please have a look to What have you tried?[^] to see a good explanation about what I mean.


What you are asking is something it should not be difficult. Start a program, try it on your own and if you don''t manage to solve it... Then come back and add the code you tried to the question using "improve question" widget. So we can correct it and explain your errors.
if we give you a ready-to-go solution, it is not going to help you because you are not going to learn anything from it.


I recommend you to start with a very simple way, just checking for only one string.
I mean, you save the "hit-string" in a variable, wait for the user input, check it and count up until you write (in example: "reset").

When that is working you can start making it more difficult, saving a list of strings in an array and comparing them or making a tiny class with a string, a repetition counter and a flag "already said"


这篇关于聊天机器人,vb.net,重复输入,Visual Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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