Hello everyone,

I'm not a very advanced programmer and here is my problem:
I'm trying to write a hangman game and I want to use online dictionaries as database.


I created a windows form application to do that. Is there a better option to achieve my aim?

I could find some pieces of codes on the internet. It just helps me to open source code of webpage.

Here is the codes I found:

string url = " ";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);                request.Method = "GET";
WebResponse wrs = request.GetResponse();
StreamReader reader = new StreamReader(wrs.GetResponseStream(), Encoding.UTF8);
string result = reader.ReadToEnd();

Can you help me?

Thanks.

Recommended Answers

All 3 Replies

I don't exactly get what you are trying to ask. The only question I see is whether windows form application is a good idea to make a hang man game. The other option is a console application or WPF application. WPF is more graphical, and but console could also get the job done.

Are you also asking about how to get words from the internet?

Sorry for not being clear.

The thing what I am trying to ask is: Is it possible to take words from internet for hangman game or not by using c#?

I can basicly use a txt file, and read words from it and randomly ask to player, without internet. However, I want to ask player different words in every game. That's why I want to create my txt file by taking words from internet whenever game is run. That's why I need to take words for the game from an internet webpage such as dictionary or somewhere else.

http://developer.dictionary.com/products

I suggest looking at that. Especially at the "Random Word Generator" that they have.

(Note: You'll need to make an account and apply for an api key)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.