<?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[Nach bestimmtem Inhalten in einer INI Datei suchen...]]></title><description><![CDATA[<p>Ich möchte in eine *.ini Datei die MAC Adresse als Haupttitel speichern:</p>
<pre><code>[00-FF-CC-CF-92-8E]
host=pc5

[43-4F-CC-C2-92-10]
host=pc200
</code></pre>
<p>...das mache ich mit:</p>
<pre><code class="language-cpp">WritePrivateProfileString(mac.c_str(), &quot;host&quot;, host.c_str(), CFILE.c_str());
</code></pre>
<p>Jetzt möchte ich gern bestimmte MAC Adressen suchen/vergleichen nur wie macht man das am besten, mit GetPrivateProfileString() würde das nicht gehn, da der erste Parameter der Titel ist denn ich ja suche.</p>
<p>Bitte um Tipps.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/160294/nach-bestimmtem-inhalten-in-einer-ini-datei-suchen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Jul 2026 04:35:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/160294.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 24 Sep 2006 15:11:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Nach bestimmtem Inhalten in einer INI Datei suchen... on Sun, 24 Sep 2006 15:11:47 GMT]]></title><description><![CDATA[<p>Ich möchte in eine *.ini Datei die MAC Adresse als Haupttitel speichern:</p>
<pre><code>[00-FF-CC-CF-92-8E]
host=pc5

[43-4F-CC-C2-92-10]
host=pc200
</code></pre>
<p>...das mache ich mit:</p>
<pre><code class="language-cpp">WritePrivateProfileString(mac.c_str(), &quot;host&quot;, host.c_str(), CFILE.c_str());
</code></pre>
<p>Jetzt möchte ich gern bestimmte MAC Adressen suchen/vergleichen nur wie macht man das am besten, mit GetPrivateProfileString() würde das nicht gehn, da der erste Parameter der Titel ist denn ich ja suche.</p>
<p>Bitte um Tipps.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1143490</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1143490</guid><dc:creator><![CDATA[kernel64]]></dc:creator><pubDate>Sun, 24 Sep 2006 15:11:47 GMT</pubDate></item><item><title><![CDATA[Reply to Nach bestimmtem Inhalten in einer INI Datei suchen... on Sun, 24 Sep 2006 15:24:31 GMT]]></title><description><![CDATA[<p>Mir ist nicht so ganz klar, was du machen möchtest, aber evtl. kannst du mit <a href="http://msdn.microsoft.com/library/en-us/sysinfo/base/getprivateprofilestring.asp" rel="nofollow">GetPrivateProfileSectionNames</a> etwas anfangen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1143494</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1143494</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sun, 24 Sep 2006 15:24:31 GMT</pubDate></item><item><title><![CDATA[Reply to Nach bestimmtem Inhalten in einer INI Datei suchen... on Sun, 24 Sep 2006 15:47:02 GMT]]></title><description><![CDATA[<p>Hab es mit der Funktion GetPrivateProfileSectionNames() geschafft die Section auszulesen.</p>
<p>Wie kann ich in einer Schleife auf alle Sections zugreifen, damit man ein string mit dem Inhalt der Section vergleichen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1143500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1143500</guid><dc:creator><![CDATA[kernel64]]></dc:creator><pubDate>Sun, 24 Sep 2006 15:47:02 GMT</pubDate></item><item><title><![CDATA[Reply to Nach bestimmtem Inhalten in einer INI Datei suchen... on Sun, 24 Sep 2006 17:28:19 GMT]]></title><description><![CDATA[<p>Glaub für dein Vorhaben sind ini-Dateien nicht das Richtige...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1143549</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1143549</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sun, 24 Sep 2006 17:28:19 GMT</pubDate></item><item><title><![CDATA[Reply to Nach bestimmtem Inhalten in einer INI Datei suchen... on Sun, 24 Sep 2006 17:51:01 GMT]]></title><description><![CDATA[<p>Also ich erklär mal kurz was ich vorhabe: Ich habe ein Client und Server, der Client muss sich beim Server registrieren, dabei versendet der Client seine MAC Adresse, diese wird beim Server in eine INI Datei gespeichert. Später möchte ich dies erweitern mit einer Passwortabfrage...<br />
In der Section [] steht die MAC Adresse:</p>
<pre><code>[00-FF-CC-CF-92-8E]
host=pc5

[43-4F-CC-C2-92-10]
host=pc200

[52-E4-56-1B-8E-83]
host=hans
</code></pre>
<p>Jetzt möchte ich die empfangene MAC Adresse mit denn Adressen aus der INI Datei vergleichen:</p>
<pre><code class="language-cpp">GetPrivateProfileSectionNames(tmp, destSize, CFILE.c_str());
	char* Key = tmp;
	while( *Key )
	{			
		if(mac == Key)//vergleiche MAC
		{
			cout &lt;&lt; &quot;Client bereits registriert&quot; &lt;&lt; endl;
			return 1;
		}
		else
		{
			cout &lt;&lt; &quot;Client wird registriert...&quot; &lt;&lt; endl;
			WritePrivateProfileString(mac.c_str(), &quot;host&quot;, host.c_str(), CFILE.c_str());
			return 1;
		}

	Key += strlen( Key ) + 1;
	}
</code></pre>
<p>Das Problem hier ist, wenn ich nach der MAC <strong>52-E4-56-1B-8E-83</strong> suche, also die letzte Adresse, dann fragt er in der while schleife alle if Abfragen ab und dabei wird der Client registriert obwohl er schon existiert.<br />
Am besten wärs wenn erst gesucht und dann gehandelt wird.</p>
<p>Bitte um Tipps</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1143563</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1143563</guid><dc:creator><![CDATA[kernel64]]></dc:creator><pubDate>Sun, 24 Sep 2006 17:51:01 GMT</pubDate></item><item><title><![CDATA[Reply to Nach bestimmtem Inhalten in einer INI Datei suchen... on Sun, 24 Sep 2006 20:35:57 GMT]]></title><description><![CDATA[<p>Warum versuchst du nicht einfach die Section auszulesen und wenn es sie gibt ist es ok, und wenn es fehl schlägt, legst du sie einfach neu an...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1143639</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1143639</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sun, 24 Sep 2006 20:35:57 GMT</pubDate></item></channel></rss>