1. Write a function that goes through your sentence and isolates individual words.
2. For each word, check if it's in a hash table that maps strings to integers (counts). If it is, increment that word's integer and save it in the hash table's entry for that word. If it isn't, insert the word into the hash table with a one count.
3. Go through the hash table and print out each word and the integer associated with it.
i am developing application which accesses all my lan machines and output their individual into the text files, but which method is good using Elog class or using wmi.or tell me is there any way to specify username and password in Elog class
Does anyone know if I can call code created in VB 6 from C# 2008?
Yes, you can.
Daniel Fowler wrote:
If so, what areas (or keywords) do I need to look up to reaserch this on?
VB6 dlls use COM. It's called COM interop.
Pretty much all you do is VS is add a reference, go to the COM tab, locate the library you want to use. VS will create an interop assembly. (You can look in this assembly to see the details of how the COM stuff is called, if you fancied doing it manually)
I have create Multiple Thread and Call the function in c#.
The Code as follows
public class Program
static void Main(string args)
Program pa = new Program();
Thread firstThread = new Thread(new ThreadStart(pa.Name));
Thread secondThread = new Thread(new ThreadStart(pa.Name));
Thread thirdThread = new Thread(new ThreadStart(pa.Name));
Thread fourthThread = new Thread(new ThreadStart(pa.Name));
Thread fifthThread = new Thread(new ThreadStart(pa.Name));
public void Name()
Console.WriteLine("My Name is Bruze" );
The above code Multiple Thread (firstThread,secondThread,thirdThread,fifthThread,fifthThread) execute one by one.
I want Multiple Thread execute at Same Time(simultaneously) in c#.
Use backgroundworker so your threads will be working asynchronously with the UI thread. but only one thread will be executed in async mode also otherwise your application will affect the main UI thread resulting in hung up application.
if you hope to get MMMMMyyyyy NNNNNaaaaammmmmeeeee iiiiisssss BBBBBrrrrruuuuuzzzzzeeeee
then your code isn't the right one. The Console class is somehow synchronized in an effort to
keep the output readable, so each Console.WriteLine will execute in sequence; the sequence of
the threads will however be random, but since they all emit the same text, you won't notice.