array<String^> ^NewUsernames = NewUsernames = gcnew array<String^>(0);

	String ^sPastedString;
	String ^sName;
	String ^sMarker = "[MARKERdfghj23l]";
	int Count;

		sPastedString = txtPasteUsernames->Text;
		txtPasteUsernames->Text = "";
		sPastedString = sPastedString->Trim();

		if (sPastedString->Length <= 1)		//Ignore single character in case user tries to type into box

		//Place markers between each name
		sPastedString = sPastedString->Replace("\r\n", sMarker);
		sPastedString = sPastedString->Replace("\n", sMarker);
		sPastedString = sPastedString->Replace("\r", sMarker);
		sPastedString = sPastedString->Replace(",", sMarker);
		sPastedString = sPastedString->Replace("\t", sMarker);
		sPastedString += "[MARKERdfghj23l]";

		//Get each name
		while (sPastedString->LastIndexOf(sMarker) > 0)
			sName = sPastedString->Substring(0, (sPastedString->IndexOf(sMarker)));
			sPastedString = sPastedString->Substring(sName->Length + sMarker->Length);

			sName = sName->Trim();
			if (sName->Length > 0)
				//Check name has not already been added
				for (Count = 0; Count < NewUsernames->Length; Count++)
					if (NewUsernames[Count] == sName)
				if (Count == NewUsernames->Length)
					//Add it to the array
					Array::Resize(NewUsernames, NewUsernames->Length + 1);
					NewUsernames[(NewUsernames->Length - 1)] = sName;

		txtUsernamesToAdd->Text = "";
		for (Count = 0; Count < NewUsernames->Length; Count++)
			txtUsernamesToAdd->Text += NewUsernames[Count] + "\r\n";
	catch (Exception ^e)
		GlobalObjects::EventLog1->AddEvent(true, 0x00, Convert::ToString(e));



We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.


Your email address will not be published.