473,473 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Checking Strings

11 New Member
I want my program to check to see if my string says a certain thing, like a password. I've tried it like this, but it says "comminity call missing argument list". Here's my code.

Expand|Select|Wrap|Line Numbers
  1. String^ password = System::Convert::ToString(textBox1->Text);
  2.  
  3. if (password->Equals == "open sesame");
  4. MessageBox::Show("Welcome!");
  5.  
  6. else
  7. MessageBox::Show("Go away!");
the problem is in the 3rd line.
Oct 19 '07 #1
3 1300
gpraghuram
1,275 Recognized Expert Top Contributor
I want my program to check to see if my string says a certain thing, like a password. I've tried it like this, but it says "comminity call missing argument list". Here's my code.

Expand|Select|Wrap|Line Numbers
  1. String^ password = System::Convert::ToString(textBox1->Text);
  2.  
  3. if (password->Equals == "open sesame");
  4. MessageBox::Show("Welcome!");
  5.  
  6. else
  7. MessageBox::Show("Go away!");
the problem is in the 3rd line.

HI,
There are a couple of issues in the 3rd line.
1); at the end of the condition(Remove the ;)
2)What Equals means
it shuld be like this
Expand|Select|Wrap|Line Numbers
  1. if(password == "open sesame")
  2.  
  3. //or
  4.  
  5. if(password.equals("open sesame")
  6.  
  7.  
Raghuram
Oct 19 '07 #2
Koolioman
11 New Member
Thank you, I will try that.
(the semicolon was a typo)
Oct 19 '07 #3
Koolioman
11 New Member
I got it to work...
Just so you know, the first example wirked, but the second one didn't.
(and I noticed the parenthase typo)
Oct 19 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: dataangel | last post by:
I was just curious if there were any spell checker python modules around that can guess at what the user meant to type in. I wrote up a quick function that splices a string up into bigrams and then...
6
by: Web Developer | last post by:
Hi, I come across the term "type checking" very often in my readings on C++, and have never heard it in Java. Besides the simplistic answer that it checks the "type", what more does it mean? ...
1
by: Cogswell | last post by:
I am working on an ecommerce app and want to be able to take my entire POST results as one item (or iterate through them) and check for any malicious SQL INJECTION items. After checking/escaping...
4
by: Edd | last post by:
Hello, I have an array of strings containing filenames. I must open each in turn and parse the data within. However, if a filename appears multiple times in the list it must still only be read...
4
by: Michael Yanowitz | last post by:
Hello: If I have a long string (such as a Python file). I search for a sub-string in that string and find it. Is there a way to determine if that found sub-string is inside single-quotes or...
6
by: Jeff | last post by:
Could someone tell me the easiest way to check a string of variable length to see if it consists of all blank characters? ....or perhaps more generally, to see if all of the characters are the...
125
by: jacob navia | last post by:
We hear very often in this discussion group that bounds checking, or safety tests are too expensive to be used in C. Several researchers of UCSD have published an interesting paper about this...
9
by: John Zenger | last post by:
To my horror, someone pointed out to me yesterday that a web app I wrote has been prominently displaying a misspelled word. The word was buried in my code. Is there a utility out there that...
7
by: nospam | last post by:
Hello I need to go through each line of a CSV file, and extract some fields using a regex. Then, I need to check each retrieved field, and if it looks like "", turn this into NULL so that it's...
12
by: Joe Strout | last post by:
On Nov 12, 2008, at 10:45 AM, Tim Rowe wrote: Because if I write a method with the intention of treating the arguments like strings in various ways (slicing, combining with other strings,...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.