<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Passwortabfrage]]></title><description><![CDATA[<p>hallo,<br />
ich hab folgenden Code der auf den ersten Blick auch geht:</p>
<pre><code>void __fastcall TFpassword::Bpw_okClick(TObject *Sender)
{
char pw[] = &quot;test&quot;;
char * passwort = Epassword-&gt;Text.c_str();
if (strcmp(passwort, pw) == 0) {
        Fpassword-&gt;Close();
        Foptions-&gt;ShowModal(); }
else {
ShowMessage(&quot;Wrong passsword, please try again.&quot;); }
Epassword-&gt;SetFocus();
Epassword-&gt;Text = &quot;&quot;;
passwort = Epassword-&gt;Text.c_str();
}
</code></pre>
<p>Beim erstmaligen eingeben erkennt der code ob das Passwort richtig oder falsch ist. Geb ich aber zuerst ein falsches Passwort ein und danach das richtige, wird es trotzdem nicht mehr als richtig erkannt.<br />
Vielleicht sieht einer ja weshalb das so ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/191484/passwortabfrage</link><generator>RSS for Node</generator><lastBuildDate>Sat, 26 Sep 2026 00:44:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/191484.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Sep 2007 16:14:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Passwortabfrage on Mon, 03 Sep 2007 16:14:58 GMT]]></title><description><![CDATA[<p>hallo,<br />
ich hab folgenden Code der auf den ersten Blick auch geht:</p>
<pre><code>void __fastcall TFpassword::Bpw_okClick(TObject *Sender)
{
char pw[] = &quot;test&quot;;
char * passwort = Epassword-&gt;Text.c_str();
if (strcmp(passwort, pw) == 0) {
        Fpassword-&gt;Close();
        Foptions-&gt;ShowModal(); }
else {
ShowMessage(&quot;Wrong passsword, please try again.&quot;); }
Epassword-&gt;SetFocus();
Epassword-&gt;Text = &quot;&quot;;
passwort = Epassword-&gt;Text.c_str();
}
</code></pre>
<p>Beim erstmaligen eingeben erkennt der code ob das Passwort richtig oder falsch ist. Geb ich aber zuerst ein falsches Passwort ein und danach das richtige, wird es trotzdem nicht mehr als richtig erkannt.<br />
Vielleicht sieht einer ja weshalb das so ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1358096</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1358096</guid><dc:creator><![CDATA[streetch]]></dc:creator><pubDate>Mon, 03 Sep 2007 16:14:58 GMT</pubDate></item><item><title><![CDATA[Reply to Passwortabfrage on Mon, 03 Sep 2007 17:07:18 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Kannst du mir verraten, warum du hier dieses char* strcmp-Gewurschtel machst? AnsiStrings kann man ganz normal vergleichen. Deine Einrückungen machen den Code auch nicht gerade lesbarer.<br />
versuchs mal so</p>
<pre><code class="language-cpp">void __fastcall TFpassword::Bpw_okClick(TObject *Sender)
{
  AnsiString test = &quot;test&quot;;
  if (Epassword-&gt;Text == test) 
  {
     Fpassword-&gt;Close();
     Foptions-&gt;ShowModal(); 
  } else 
  {
     ShowMessage(&quot;Wrong passsword, please try again.&quot;); 
  }
  Epassword-&gt;Text = &quot;&quot;;
  Epassword-&gt;SetFocus();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1358149</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1358149</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Mon, 03 Sep 2007 17:07:18 GMT</pubDate></item></channel></rss>