|
|
hi to all....... i have made a text box on my web page.....i want that when a user enters the name of the place in that box then the words that sounds same should be displayed at that time........like if i want to enter haridwar then as it is same as hardwar then both these should be displayed...same as it happens in google searching.........how can i do it?????
|
|
|
|
|
Check out the SoundEx algorithm. You can write a method-extension that converts a string to it's soundex equivalent.
You will need a list of words though
|
|
|
|
|
Hi,
As i have a small doubt that why if i don't convert a integer to a string using ToString() method then also the output is coming. can any one try this.
Example Code:
int year = 1998;
string message = "Sandy was born in " + year.ToString();//Here if i remove the ToString() //also the code working properly
System.Console.WriteLine(message);
System.Console.ReadLine();
|
|
|
|
|
It still works because, the '+' operator has been overloaded to take various different combinations of types. In this case, the + operator is taking a string an an integer so is calling its overload for 2 objects: String.Concat(Object, Object)
The integer gets boxed as an object.
The Concat() method obviously then calls ToString() on the objects, concatenates the strings and returns the result. Which is then assigned to the 'message' variable.
You can confirm this by using ILDasm to look at the compiled IL.
(Because there is boxing occurring, this is not as efficient as calling ToString() on the integer yourself, although for most cases it won't actually make any difference)
Simon
|
|
|
|
|
Thanks for your response. But actually i did this small program using visual studio 2005. In that how can i use the ILDASM tool. It can be used only when i work with command prompt know. Can you please suggest me....
|
|
|
|
|
You can download the .NET Reflector and view the code as IL code.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Open up a visual studio command prompt (in the start menu, under visual studio tools).
Type the command ildasm
Click File->Open and select your program. This will show you a tree of the various classes and namespaces within your program. You will be able to browse to the method you are interested in and view the IL for that method.
It's quite an advanced tool, and much use if you are just starting out with .net. I used it to verify what method the '+' overload was calling.
Simon
|
|
|
|
|
Instead of using ILDASM directly I recommend using Reflector instead and having a GUI version.
http://www.red-gate.com/products/reflector/[^]
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Good morning,
Ive spent a few days trying to work this one out and was hoping that maybe someone else had experienced this problem.
I am receiving a Soap envelope through a TCPListener and TCPClient. That part works fine as I move the message to a stringbuilder.
The problem comes when trying to load the string back to an Xml document in c#. Heres a snippet of my code
public string InsertTagLocation(string OuterXML)
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(OuterXML);
OuterXml contains the soap message which looks like this (its a long message so Ive cut it off. The problem lies with the AESNotification message=\". It appears this maybe an embedded xml or something so I wanted to know why LoadXml doesnt work with this string or what classes to use to deal with this problem?
"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"><SOAP-ENV:Body><Notify><AesNotification message=\"<NorthboundNotificationEvent><AesTagLocation calcFloorId=\"6\" calcX=\"64.81\" calcY=\"13.93\" changedOn=\"1224749515732\"
The Soap message has an end tag for this message as well.
></NorthboundNotificationEvent>\"/></Notify></SOAP-ENV:Body></SOAP-ENV:Envelope>"
Any help, advice would be much appreciated
Cheers
Scott
|
|
|
|
|
Hi,
I'm now coding a tool to draw shapes like Visio.
I notice that in Visio there are some functions to combine 2 or more shapes like Union, Intersect, Combine...,
I don't know how to do it in C#. Currently I create a GraphicsPath, then assign some rect, ellipse to it, then create a Region and add the GraphicsPath to it.
I can then fill the region, but for the outline, I don't know how to draw.
And it's just similar to Union in Visio, what about other?
Thanks alot for your help.
|
|
|
|
|
I'm finding some documents about 3 layers model. Could you please share me some ? And please don't lead me to "Google"
|
|
|
|
|
3 layers of what? Are you talking about database layer logic layer and UI layer?
Explain exactly what you are looking for?
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
3 layer database programming!
|
|
|
|
|
The explanation on three-tier models from MSDN;
http://msdn.microsoft.com/en-us/library/bb384398.aspx
A walk through on creating an N-tier application;
http://msdn.microsoft.com/en-us/library/bb384570.aspx
You might want to read up on the Wikipedia also
|
|
|
|
|
Thax so much for your reply
|
|
|
|
|
I cannot find a way to do that in C#... gave MemoryMappedFile a try, File is written to disk as well. I'm looking for a solution to write only to disk....
|
|
|
|
|
You need to create a file on Hard drive?
Use methods from the built in classes of .net framework (File and Stream writer)
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Hi, thanks...
I need the file to be in memory and not on hard drive....
|
|
|
|
|
Use a MemoryStream
Works the same like writing to disk.
|
|
|
|
|
True, but I have to avoid the disk writings, that I cannot do...
|
|
|
|
|
The MemoryStream won't write to a file. That is, until your memory is full and Windows starts swapping to disk.
You're gonna read/write a lot from several places in a single datastore? You've probably already tried it, but I still want to suggest the use of a database. There are some data-driven websites out there, serving lots o' people at once..
This site is one of them
--Edit--
Removed some typo's..
|
|
|
|
|
What type of file?
And for what will it be used?
Have a look at
System.IO.MemoryStream
|
|
|
|
|
I would like to place a pointer in a mapped memory file for all dll's share... It has to be in memmory for preformance rather then on disk...
|
|
|
|
|
You would have to use the Windows API to use a Memory Mapped File and potentially unsafe code. However, I believe that the FileStream class uses the Memory Mapped File under the scenes.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|