Ik maak een vraag antwoord programma in c# waarbij je een windows notificatie krijgt met een antwoord als de vraag is gekopieerd.
Voorbeeldje.
1+1
Als ik dit kopieer zal je dan een windows notificatie met de betreffende vraag 1+1 krijgen plus het betreffende antwoord.
Nu wil ik dat mijn programma ook een deel van de vraag kan kopieren en daarbij kijkt waarbij het deel van de zin het best matched bij me vraag zitten uit mijn list.
Zodat je ook een windows notificatie krijgt als je maar een deel van de zin uit de list kopieerd
Ik heb al wel eens gekeken naar de startwith methode maar ik heb meer dan 700 vragen in mijn list.
Dus ik wil een efficiente manier om te kijken welke deel van de zin het best matched met de gehele vraag.
Ik denk dat ik een StartWith methode moet gebruiken maar hoe ik het moet doen weet ik tot op heden helaas nog niet precies. Misschien kan iemand me hierbij helpen.
dit is mijn code.
alvast bedankt
Voorbeeldje.
1+1
Als ik dit kopieer zal je dan een windows notificatie met de betreffende vraag 1+1 krijgen plus het betreffende antwoord.
Nu wil ik dat mijn programma ook een deel van de vraag kan kopieren en daarbij kijkt waarbij het deel van de zin het best matched bij me vraag zitten uit mijn list.
Zodat je ook een windows notificatie krijgt als je maar een deel van de zin uit de list kopieerd
Ik heb al wel eens gekeken naar de startwith methode maar ik heb meer dan 700 vragen in mijn list.
Dus ik wil een efficiente manier om te kijken welke deel van de zin het best matched met de gehele vraag.
Ik denk dat ik een StartWith methode moet gebruiken maar hoe ik het moet doen weet ik tot op heden helaas nog niet precies. Misschien kan iemand me hierbij helpen.
dit is mijn code.
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
| //*SNIP* BLABLA namespace it { public partial class Form1 : Form { //*SNIP* BLABLA //Make some global variables so we can access them somewhere else later //This will store all Questions and Answers //In here will be the Questions and Answers List<question> questionList = new List<question>(); private void Form1_Load(object sender, EventArgs e) { //*SNIP* BLABLA //Add question/answer to list //hoofdstuk 3 it question newQuestion = new question("When a computer is being assembled, which action can be taken to help eliminate cable clutter within a computer case?", "Install a modular power supply.*"); questionList.Add(newQuestion); newQuestion = new question("What is the best way to apply thermal compound when reseating a CPU?", "Clean the CPU and the base of the heat sink with isopropyl alcohol before applying the thermal compound.*"); questionList.Add(newQuestion); //** SNIP ** paar honderd regels van hetzelfde newQuestion = new question("Which three factors are reasons for a company to choose a client/server model for a network instead of peer-to-peer? (Choose three.)", "The company network requires secure access to confidential information.*The users need a central database to store inventory and sales information.*The data gathered by the employees is critical and should be backed up on a regular basis.*"); questionList.Add(newQuestion); newQuestion = new question("What is a characteristic of a WAN?", "It connects multiple networks that are geographically separated.*"); } private void GetAnswer(string clipboardText) { //Loop through all questions and answers foreach (question q in questionList) { //If we have found an answer that is exactly the same show an Notification if (q._question == clipboardText) { ShowNotification(q._question, q._answer); } } } //*SNIP* BLABLA } } |
alvast bedankt
[ Voor 105% gewijzigd door RobIII op 01-03-2019 14:16 ]