Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 262

db4o-doc-7.4-2.fc13.i686.rpm

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Limiting the Number of Users</title>
    <link rel="stylesheet" type="text/css" href="../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>Limiting the Number of Users</h1><script>
//We attach this function to a browser object as a variable so that if multiple of these blocks are
//present on the same page, then they will simply over-write eachother with the same function instead
//of generating a naming collision.
window.WikiCodeFormattingCopyToClipboard = function copyToClipboard(sID){
	var sContent = document.getElementById(sID).innerText;
	if( window.clipboardData && clipboardData.setData )
	{
		clipboardData.setData("Text", sContent);
	}
	else
	{
		alert("You must enable javascript access to your clipboard for this feature to work. Please referr to your browser documentation or Google search for instructions.");
	}
}
</script>


<span name="cs_wiki_filter" csw_filters="cs">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">LimitLogins.cs</span></div><div class="fscCode"><pre ID="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_0_67_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_0_67_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_0_67_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_0_67_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_0_67_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_0_67_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_0_67_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_0_67_Open_Text').style.display='inline';"/><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_0_67_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">/**/</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_0_67_Open_Text"><span style="color: #008000;">/*</span><span style="color: #008000;"> Copyright (C) 2004 - 2007 db4objects Inc. </span><span style="color: #008000; text-decoration: underline;">http://www.db4o.com</span><span style="color: #008000;"> </span><span style="color: #008000;">*/</span></span><span style="color: #000000;">
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System;
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.IO;
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">using</span><span style="color: #000000;"> Db4objects.Db4o;
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> Db4objects.Db4odoc.Semaphores
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_163_1116_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_163_1116_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_163_1116_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_163_1116_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_163_1116_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_163_1116_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_163_1116_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_163_1116_Open_Text').style.display='inline';"/></span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_163_1116_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_163_1116_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_166_271_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_166_271_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_166_271_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_166_271_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_166_271_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_166_271_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_166_271_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_166_271_Open_Text').style.display='inline';"/>  </span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_166_271_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">/**/</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_166_271_Open_Text"><span style="color: #008000;">/*</span><span style="color: #008000;">*
</span><span style="color: #008080;">09</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>   * This class demonstrates the use of semaphores to limit the
</span><span style="color: #008080;">10</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>   * number of logins to a server.
</span><span style="color: #008080;">11</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>   </span><span style="color: #008000;">*/</span></span><span style="color: #000000;">
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>  </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> LimitLogins 
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_300_1114_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_300_1114_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_300_1114_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_300_1114_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_300_1114_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_300_1114_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_300_1114_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_300_1114_Open_Text').style.display='inline';"/>  </span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_300_1114_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_300_1114_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">readonly</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> Host </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">localhost</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">readonly</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">int</span><span style="color: #000000;"> Port </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">4455</span><span style="color: #000000;">;
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">readonly</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> User </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">db4o</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">readonly</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> Password</span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">db4o</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">readonly</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">int</span><span style="color: #000000;"> MaximumUsers </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">10</span><span style="color: #000000;">; 
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> IObjectContainer Login()
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_565_1111_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_565_1111_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_565_1111_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_565_1111_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_565_1111_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_565_1111_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_565_1111_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_565_1111_Open_Text').style.display='inline';"/>    </span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_565_1111_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_565_1111_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        
</span><span style="color: #008080;">25</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectContainer objectContainer;
</span><span style="color: #008080;">26</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">try</span><span style="color: #000000;"> 
</span><span style="color: #008080;">27</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_624_704_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_624_704_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_624_704_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_624_704_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_624_704_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_624_704_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_624_704_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_624_704_Open_Text').style.display='inline';"/>      </span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_624_704_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_624_704_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">28</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        objectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenClient(Host, Port, User, Password);
</span><span style="color: #008080;">29</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;"> 
</span><span style="color: #008080;">30</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (IOException e) 
</span><span style="color: #008080;">31</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_735_758_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_735_758_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_735_758_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_735_758_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_735_758_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_735_758_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_735_758_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_735_758_Open_Text').style.display='inline';"/>      </span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_735_758_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_735_758_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">32</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
</span><span style="color: #008080;">33</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">34</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        
</span><span style="color: #008080;">35</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> allowedToLogin </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">false</span><span style="color: #000000;">;
</span><span style="color: #008080;">36</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        
</span><span style="color: #008080;">37</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">for</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">int</span><span style="color: #000000;"> i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">; i </span><span style="color: #000000;">&lt;</span><span style="color: #000000;"> MaximumUsers; i</span><span style="color: #000000;">++</span><span style="color: #000000;">) 
</span><span style="color: #008080;">38</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_855_982_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_855_982_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_855_982_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_855_982_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_855_982_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_855_982_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_855_982_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_855_982_Open_Text').style.display='inline';"/>      </span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_855_982_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_855_982_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">39</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">if</span><span style="color: #000000;">(objectContainer.Ext().SetSemaphore(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">max_user_check_</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> i, </span><span style="color: #800080;">0</span><span style="color: #000000;">))
</span><span style="color: #008080;">40</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_930_977_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_930_977_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_930_977_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_930_977_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_930_977_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_930_977_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_930_977_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_930_977_Open_Text').style.display='inline';"/>        </span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_930_977_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_930_977_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">41</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>          allowedToLogin </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">;
</span><span style="color: #008080;">42</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>          </span><span style="color: #0000FF;">break</span><span style="color: #000000;">;
</span><span style="color: #008080;">43</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>        }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">44</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">45</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        
</span><span style="color: #008080;">46</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">if</span><span style="color: #000000;">(</span><span style="color: #000000;">!</span><span style="color: #000000;"> allowedToLogin)
</span><span style="color: #008080;">47</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_1019_1071_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_1019_1071_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_1019_1071_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_1019_1071_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_1019_1071_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_1019_1071_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_1019_1071_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_1019_1071_Open_Text').style.display='inline';"/>      </span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_1019_1071_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresCS.ZipsLimitLogins.Cs_LimitLogins.Cs_53_45_1019_1071_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">48</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        objectContainer.Close();
</span><span style="color: #008080;">49</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
</span><span style="color: #008080;">50</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">51</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        
</span><span style="color: #008080;">52</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> objectContainer;
</span><span style="color: #008080;">53</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">54</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>  }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">55</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>}</span></span></div></pre></div></div>
</span>
<span name="cs_wiki_filter" csw_filters="vb">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">LimitLogins.vb</span></div><div class="fscCode"><pre ID="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #008000;">'</span><span style="color: #008000;"> Copyright (C) 2004 - 2007 db4objects Inc. http://www.db4o.com </span><span style="color: #008000;">
</span><span style="color: #008080;">02</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">Imports</span><span style="color: #000000;"> System
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">Imports</span><span style="color: #000000;"> System.IO
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">Imports</span><span style="color: #000000;"> Db4objects.Db4o
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_123_1423_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_123_1423_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_123_1423_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_123_1423_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_123_1423_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_123_1423_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_123_1423_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_123_1423_Open_Text').style.display='inline';"/></span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_123_1423_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Namespace Db4objects</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_123_1423_Open_Text"><span style="color: #0000FF;">Namespace</span><span style="color: #000000;"> Db4objects.Db4odoc.Semaphores
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #008000;">'</span><span style="color: #008000;">   </span><span style="color: #008000;">
</span><span style="color: #008080;">08</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">    </span><span style="color: #008000;">'</span><span style="color: #008000;">    This class demonstrates the use of semaphores to limit the</span><span style="color: #008000;">
</span><span style="color: #008080;">09</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">    </span><span style="color: #008000;">'</span><span style="color: #008000;">    number of logins to a server.</span><span style="color: #008000;">
</span><span style="color: #008080;">10</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">    </span><span style="color: #008000;">'</span><span style="color: #008000;">   </span><span style="color: #008000;">
</span><span style="color: #008080;">11</span><span style="color: #008000;"><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_295_1409_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_295_1409_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_295_1409_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_295_1409_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_295_1409_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_295_1409_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_295_1409_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_295_1409_Open_Text').style.display='inline';"/></span><span style="color: #000000;">    </span><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_295_1409_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Class LimitLogins</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_295_1409_Open_Text"><span style="color: #0000FF;">Class</span><span style="color: #000000;"> LimitLogins
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span style="color: #0000FF;">ReadOnly</span><span style="color: #000000;"> Host </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">String</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">localhost</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span style="color: #0000FF;">ReadOnly</span><span style="color: #000000;"> Port </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Integer</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">4455</span><span style="color: #000000;">
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span style="color: #0000FF;">ReadOnly</span><span style="color: #000000;"> User </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">String</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">db4o</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span style="color: #0000FF;">ReadOnly</span><span style="color: #000000;"> Password </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">String</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">db4o</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span style="color: #0000FF;">ReadOnly</span><span style="color: #000000;"> MaximumUsers </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Integer</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">10</span><span style="color: #000000;">
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_591_1395_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_591_1395_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_591_1395_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_591_1395_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_591_1395_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_591_1395_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_591_1395_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_591_1395_Open_Text').style.display='inline';"/>        </span><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_591_1395_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Function Login()</span><span id="ResourcesReferenceClient-ServerSemaphoressemaphoresVB.ZipsLimitLogins.Vb_LimitLogins.Vb_156_45_591_1395_Open_Text"><span style="color: #0000FF;">Function</span><span style="color: #000000;"> Login() </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> objectContainer </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                objectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenClient(Host, Port, User, Password)
</span><span style="color: #008080;">25</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Catch</span><span style="color: #000000;"> e </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IOException
</span><span style="color: #008080;">26</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;">
</span><span style="color: #008080;">27</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">28</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">29</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> allowedToLogin </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Boolean</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">False</span><span style="color: #000000;">
</span><span style="color: #008080;">30</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">31</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> i </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Integer</span><span style="color: #000000;">
</span><span style="color: #008080;">32</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">For</span><span style="color: #000000;"> i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;"> </span><span style="color: #0000FF;">To</span><span style="color: #000000;"> MaximumUsers </span><span style="color: #000000;">-</span><span style="color: #000000;"> </span><span style="color: #800080;">1</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Step</span><span style="color: #000000;"> i </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800080;">1</span><span style="color: #000000;">
</span><span style="color: #008080;">33</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">If</span><span style="color: #000000;"> objectContainer.Ext().SetSemaphore(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">max_user_check_</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> i.ToString(), </span><span style="color: #800080;">0</span><span style="color: #000000;">) </span><span style="color: #0000FF;">Then</span><span style="color: #000000;">
</span><span style="color: #008080;">34</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    allowedToLogin </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">True</span><span style="color: #000000;">
</span><span style="color: #008080;">35</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #0000FF;">Exit</span><span style="color: #000000;"> </span><span style="color: #0000FF;">For</span><span style="color: #000000;">
</span><span style="color: #008080;">36</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">If</span><span style="color: #000000;">
</span><span style="color: #008080;">37</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Next</span><span style="color: #000000;">
</span><span style="color: #008080;">38</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">39</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">If</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Not</span><span style="color: #000000;"> allowedToLogin </span><span style="color: #0000FF;">Then</span><span style="color: #000000;">
</span><span style="color: #008080;">40</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                objectContainer.Close()
</span><span style="color: #008080;">41</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;">
</span><span style="color: #008080;">42</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">If</span><span style="color: #000000;">
</span><span style="color: #008080;">43</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">44</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Return</span><span style="color: #000000;"> objectContainer
</span><span style="color: #008080;">45</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Function</span></span><span style="color: #000000;">
</span><span style="color: #008080;">46</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    </span><span style="color: #0000FF;">End Class</span></span><span style="color: #000000;">
</span><span style="color: #008080;">47</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/></span><span style="color: #0000FF;">End Namespace</span></span></div></pre></div></div>
</span></div>
    </div>
    <div id="footer">
					This revision (5) was last Modified 2006-11-14T12:01:39 by Tetyana.
				</div>
  </body>
</html>