• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Help With C# Console Application (Probably Easy)

Joe Compton

New Member
Joined
Nov 28, 2016
Messages
13 (0.00/day)
I've been set a task, but I don't know where to start as I've been ill so couldn't go to lessons, I'm not too sure what to do.

It's basically to make a wordsearch application in C# (Console Application) that reads the word from .txt files.

I have a whole specification, I'm not asking for it to be done, just where to start and a little bit of advice. I might be aware that this isn't the best place to ask, but it's sort of a last resort. PM me if you're willing to help out and I'll send you the specification.
 

FordGT90Concept

"I go fast!1!11!1!"
Joined
Oct 13, 2008
Messages
26,259 (4.62/day)
Location
IA, USA
System Name BY-2021
Processor AMD Ryzen 7 5800X (65w eco profile)
Motherboard MSI B550 Gaming Plus
Cooling Scythe Mugen (rev 5)
Memory 2 x Kingston HyperX DDR4-3200 32 GiB
Video Card(s) AMD Radeon RX 7900 XT
Storage Samsung 980 Pro, Seagate Exos X20 TB 7200 RPM
Display(s) Nixeus NX-EDG274K (3840x2160@144 DP) + Samsung SyncMaster 906BW (1440x900@60 HDMI-DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay + USB 3.2 (A+C) 3.5" bay
Audio Device(s) Realtek ALC1150, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse Nixeus REVEL-X
Keyboard Tesoro Excalibur
Software Windows 10 Home 64-bit
Benchmark Scores Faster than the tortoise; slower than the hare.
I assume you created the project.

System.IO has your file streams. I would personally use StreamReader but you may want to investigate TextReader too. If you decide to use TextReader you may have to hand it a StreamReader because TextReader doesn't manage the stream itself.

Your actual searching... if it is less than 32,768 characters long, you could put it in a string and use IndexOf or IndexOfAny. The best way to do it technically is using the System.Text ASCII or Unicode classes to find an instance of a string within a string.
 

Joe Compton

New Member
Joined
Nov 28, 2016
Messages
13 (0.00/day)
Is there any chance I can PM you the spec, and you tell me the best way?

Thank you for your reply.
 
Top