<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Barry Dobson &#187; Development</title>
	<atom:link href="http://www.barrydobson.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.barrydobson.com</link>
	<description>Web Development And Beyond.</description>
	<lastBuildDate>Wed, 13 May 2009 12:03:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PLS-00103: Encountered the symbol &quot;&quot; WHEN expecting one OF the following</title>
		<link>http://www.barrydobson.com/2009/02/17/pls-00103-encountered-the-symbol-when-expecting-one-of-the-following/</link>
		<comments>http://www.barrydobson.com/2009/02/17/pls-00103-encountered-the-symbol-when-expecting-one-of-the-following/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 15:06:22 +0000</pubDate>
		<dc:creator>Barry Dobson</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.barrydobson.com/2009/02/17/pls-00103-encountered-the-symbol-when-expecting-one-of-the-following/</guid>
		<description><![CDATA[
			
				
			
		
I recently came across this error whilst developing stored procedures in oracle. The stored procedure will be built in Oracle but marked as invalid. Trying a re-compile will give you the above error.
The problem appears to be with Windows CRLF characters on line breaks. Oracle does not treat this as white space, instead it sees [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.barrydobson.com%2F2009%2F02%2F17%2Fpls-00103-encountered-the-symbol-when-expecting-one-of-the-following%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.barrydobson.com%2F2009%2F02%2F17%2Fpls-00103-encountered-the-symbol-when-expecting-one-of-the-following%2F&amp;source=barrydobson&amp;style=normal&amp;service=bit.ly&amp;service_api=R_afcfcb0f75307325636188928ea62464" height="61" width="50" /><br />
			</a>
		</div>
<p>I recently came across this error whilst developing stored procedures in oracle. The stored procedure will be built in Oracle but marked as invalid. Trying a re-compile will give you the above error.</p>
<p>The problem appears to be with Windows CRLF characters on line breaks. Oracle does not treat this as white space, instead it sees it as an empty string. In order to get round this problem, convert the CRLF characters to LF characters and Oracle should be happy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barrydobson.com/2009/02/17/pls-00103-encountered-the-symbol-when-expecting-one-of-the-following/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using VB.Net To Encrypt LDAP MD5 Passwords</title>
		<link>http://www.barrydobson.com/2009/02/11/using-vbnet-to-encrypt-ldap-md5-passwords/</link>
		<comments>http://www.barrydobson.com/2009/02/11/using-vbnet-to-encrypt-ldap-md5-passwords/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 09:13:14 +0000</pubDate>
		<dc:creator>Barry Dobson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://www.barrydobson.com/2009/02/11/using-vbnet-to-encrypt-ldap-md5-passwords/</guid>
		<description><![CDATA[
			
				
			
		
When passwords are stored in an LDAP directory they are stored encrypted. LDAP supports different types of hashing, but I chose to use MD5.  The LDAP implementation is to use Base 64 encoding. Below is a simple function I use to convert the plain text password into a hashed string ready to be added to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.barrydobson.com%2F2009%2F02%2F11%2Fusing-vbnet-to-encrypt-ldap-md5-passwords%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.barrydobson.com%2F2009%2F02%2F11%2Fusing-vbnet-to-encrypt-ldap-md5-passwords%2F&amp;source=barrydobson&amp;style=normal&amp;service=bit.ly&amp;service_api=R_afcfcb0f75307325636188928ea62464" height="61" width="50" /><br />
			</a>
		</div>
<p>When passwords are stored in an LDAP directory they are stored encrypted. LDAP supports different types of hashing, but I chose to use MD5.  The LDAP implementation is to use Base 64 encoding. Below is a simple function I use to convert the plain text password into a hashed string ready to be added to LDAP.</p>
<pre class="vb.net:nogutter">Public Shared Function EncryptPassword(ByVal value As String) As String

        Dim cryptProvider As New MD5CryptoServiceProvider
        Dim b As Byte() = Text.UTF8Encoding.UTF8.GetBytes(value)
        Dim encoded As Byte() = cryptProvider.ComputeHash(b)
        Dim hash As String = Convert.ToBase64String(encoded)

        Return hash

End Function</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.barrydobson.com/2009/02/11/using-vbnet-to-encrypt-ldap-md5-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VB.Net HttpWebRequest Takes A Long Time On First Request</title>
		<link>http://www.barrydobson.com/2009/01/21/vbnet-httpwebrequest-takes-a-long-time-on-first-request/</link>
		<comments>http://www.barrydobson.com/2009/01/21/vbnet-httpwebrequest-takes-a-long-time-on-first-request/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 12:12:12 +0000</pubDate>
		<dc:creator>Barry Dobson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://www.barrydobson.com/2009/01/21/vbnet-httpwebrequest-takes-a-long-time-on-first-request/</guid>
		<description><![CDATA[
			
				
			
		
I have recently been using the HttpWebRequest object in .Net Framework 2 and 3.5. I&#8217;m using it to observe the timings of requests on a project and noticed some strange behaviour. The first time you call GetResponse it can take over 30 seconds to return the response, whereas subsequent calls to the same URL will [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.barrydobson.com%2F2009%2F01%2F21%2Fvbnet-httpwebrequest-takes-a-long-time-on-first-request%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.barrydobson.com%2F2009%2F01%2F21%2Fvbnet-httpwebrequest-takes-a-long-time-on-first-request%2F&amp;source=barrydobson&amp;style=normal&amp;service=bit.ly&amp;service_api=R_afcfcb0f75307325636188928ea62464" height="61" width="50" /><br />
			</a>
		</div>
<p>I have recently been using the HttpWebRequest object in .Net Framework 2 and 3.5. I&#8217;m using it to observe the timings of requests on a project and noticed some strange behaviour. The first time you call GetResponse it can take over 30 seconds to return the response, whereas subsequent calls to the same URL will result in much quicker responses. I have found the problem to be in the use of proxies. It tries to find a proxy to use on the first request. To fix this (unless you are using a proxy of course) set the Proxy property to Nothing</p>
<pre class="vb.net:nogutter:nocontrols">request.Proxy = Nothing</pre>
<p>By doing this it no longer looks for the default proxy and will speed up requests.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barrydobson.com/2009/01/21/vbnet-httpwebrequest-takes-a-long-time-on-first-request/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deleting LDAP Entries</title>
		<link>http://www.barrydobson.com/2008/08/14/deleting-ldap-entries/</link>
		<comments>http://www.barrydobson.com/2008/08/14/deleting-ldap-entries/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 10:15:26 +0000</pubDate>
		<dc:creator>Barry Dobson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://www.barrydobson.com/2008/08/14/deleting-ldap-entries/</guid>
		<description><![CDATA[
			
				
			
		
Following on from my popular post on searching LDAP directories I thought I&#8217;d follow up with a simple piece of code that allows you to delete entries.
There are two ways to remove an entry. The first way is to search for a node an remove it, along with all of its children. The second way [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.barrydobson.com%2F2008%2F08%2F14%2Fdeleting-ldap-entries%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.barrydobson.com%2F2008%2F08%2F14%2Fdeleting-ldap-entries%2F&amp;source=barrydobson&amp;style=normal&amp;service=bit.ly&amp;service_api=R_afcfcb0f75307325636188928ea62464" height="61" width="50" /><br />
			</a>
		</div>
<p>Following on from my popular post on searching LDAP directories I thought I&#8217;d follow up with a simple piece of code that allows you to delete entries.</p>
<p>There are two ways to remove an entry. The first way is to search for a node an remove it, along with all of its children. The second way is to search for a node and remove one or more of its children. <span id="more-40"></span>Below I will demonstrate both methods.</p>
<p> </p>
<pre class="vb.net:nogutter">Dim dir As New LdapConnection(MySettings)

Using users As DirectoryEntry = dir.GetObject(MyQuery)
    For Each r As DirectoryEntry In users.Children
        users.Children.Remove(r)
    Next
    users.CommitChanges()
End Using</pre>
<p> </p>
<p>Above shows us searching for a node then looping through each child and removing it. We could also examine the properties and delete based on that.</p>
<p>If you want to delete a specific item its easier and more efficient to use the following method</p>
<p> </p>
<pre class="vb.net:nogutter">Using users As DirectoryEntry = dir.GetObject(MyUserQuery)
    users.DeleteTree()
    users.CommitChanges()
End Using</pre>
<p> </p>
<p>In the above example we just search directly for a single node (user) then call the &#8216;DeleteTree&#8217; method. It the entry we searched for had any children, they would also be deleted.</p>
<p> </p>
<p>I hope this helps you out. Don&#8217;t forget to leave comments if this helped, or you need any more info, thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barrydobson.com/2008/08/14/deleting-ldap-entries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working With LDAP In VB.Net</title>
		<link>http://www.barrydobson.com/2008/06/13/working-with-ldap-in-vbnet/</link>
		<comments>http://www.barrydobson.com/2008/06/13/working-with-ldap-in-vbnet/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 12:51:36 +0000</pubDate>
		<dc:creator>Barry Dobson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://www.barrydobson.com/?p=29</guid>
		<description><![CDATA[wrote a post a while ago dealing with an error that VB can throw when dealing with an LDAP connection, you can find it here. Because this post has proved popular with people searching for the error code on Google, I thought I'd put together a quick post on using LDAP in VB.Net.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.barrydobson.com%2F2008%2F06%2F13%2Fworking-with-ldap-in-vbnet%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.barrydobson.com%2F2008%2F06%2F13%2Fworking-with-ldap-in-vbnet%2F&amp;source=barrydobson&amp;style=normal&amp;service=bit.ly&amp;service_api=R_afcfcb0f75307325636188928ea62464" height="61" width="50" /><br />
			</a>
		</div>
<p>I wrote a post a while ago dealing with an error that VB can throw when dealing with an LDAP connection, you can find it <a href="http://www.barrydobson.com/2007/08/31/systemdirectoryentry-unknown-error-0x80005000/" target="_blank">here</a>. Because this post has proved popular with people searching for the error code on Google, I thought I&#8217;d put together a quick post on using LDAP in VB.Net.</p>
<p><span id="more-29"></span></p>
<h3>Simple Directory Search</h3>
<p>To perform a simple query you can use the following syntax:</p>
<pre class="vb.net:nogutter" name="code">Dim results as SearchResultCollection

Using dir As New DirectoryEntry(connectionPath, principle, credentials, AuthenticationTypes.ServerBind)
	Dim s As New DirectorySearcher
	s.SearchRoot = dir
        s.Filter = (&amp;(objectClass=groupOfUniqueNames)(cn=techSupport))
        s.SearchScope = SearchScope.Subtree
        results = s.FindAll
End Using
</pre>
<ol>
<li>First we are declaring a variable to hold our search results.
<li>Next we open up a connection to the LDAP directory. This is done by instantiating a DirectoryEntry object. The DirectoryEntry object requires the connection path in the form of a URL (LDAP://MyServer:10389/OU=subdir,O=parent&#8221;), the principle (&#8220;uid=myuser,ou=system&#8221;), credentials (&#8220;mypassword&#8221;), and the method of authentication (this will depend upon your LDAP directory).
<li>In order to search the directory we need to use the DirectorySearcher Object. We assign our DirectoryEntry object to the SearchRoot property, this will tell the DirectorySearcher where to base its search. The Filter property needs the details of what we are searching for, in this example we are looking for an entry whose ObjectClass is &#8220;groupOfUniqueNames&#8221; and CN is &#8220;techSupport&#8221;. The ampersand in front of the query tells the searcher this is an AND operation. The SearchScope property tells the searcher that we want to search the whole sub tree from the SearchRoot down.
<li>Lastly we return the results.</li>
</ol>
<p>This is a very basic example of searching the directory. The directory is searchable on any property that an object may have, e.g. you may want to find all entries whose are inetOrgPerson and have a surname of smith. In that example your filter would be
<pre lang="vbnet">(&amp;(objectClass=inetOrgPerson)(sn=Smith))</pre>
</p>
<h3>Performing An Update</h3>
<p>You can perform an update on a directory entry just like you can in a database. When performing an update it is important to remember an entry can have multiple properties of the same name. In other words the properties are in fact arrays. The following is an example of an update.</p>
<p>
<pre class="vb.net:nogutter" name="code">Public Sub UpdateUser(ByVal username as String, ByVal firstName as String, ByVal surname as String)

        Dim myUserDN As String = String.Format("{0}uid={1},{2}", _settings.LDAPUrl, username, _settings.UsersDN)
	Using u As New DirectoryEntry(myUserDN, _settings.Principle, _settings.Credentials, AuthenticationTypes.ServerBind)
	    AddUpdateProperty(u, "cn", firstName)
            AddUpdateProperty(u, "sn", surname)
 	    u.CommitChanges()
	End Using
End Sub

Private Sub AddUpdateProperty(ByVal r As DirectoryEntry, ByVal propName As String, ByVal value As Object)
        If r.Properties(propName).Count = 0 Then
            r.Properties(propName).Add(value)
        Else
            r.Properties(propName).Item(0) = value
	End If
End Sub
</pre>
</p>
<p>The above code shows two sub routines. Lets look at the first one, UpdateUser:</p>
<ol>
<li>First we construct the URL to the object we want. We supply the LDAP URL along with the path to the entry we want.
<li>Next we attempt to connect straight to our entry using the DirectoryEntry object. If the object is not found this line will throw a DirectoryServicesCOMException exception.
<li>Now we can go ahead and update the properties we need to change. This is done via a helper function to handle the fact the entry could contain none, one or many of the property.
<li>Lastly we call the CommitChanges method on the Directory Entry.</li>
</ol>
<h3>Performing An Insert</h3>
<p>Performing an insert on the directory is very similar to performing an update. The code below shows how we can insert a new user type entry.</p>
<p>
<pre class="vb.net:nogutter" name="code">Using users As New DirectoryEntry(userDNRoot, _settings.Principle, _settings.Credentials, AuthenticationTypes.ServerBind)
    Using newUser As DirectoryEntry = users.Children.Add(String.Format("uid={0}", username), "person")

        ' add user required properties
        AddUpdateProperty(newUser, "cn", forename)
        AddUpdateProperty(newUser, "sn", surname)
        newUser.CommitChanges()
    End Using
End Using
</pre>
<p>Lets look at the code:</p>
<ol>
<li>We need to connect to the LDAP directory. This time we connect to the root DN of where we want to add our new entry. Think of this as XML, we are going to add a child entry to the root.
<li>Once we have a connection, we can use the Children.Add methods to create a new DirectoryEntry object. As a parameter we pass in the name of the entry.
<li>Using the same helper function we saw above in the update functionality we create the properties on the object (note that this is a shortened list).
<li>Once we have assigned all the properties we go ahead and commit changes.</li>
</ol>
<p>&nbsp;</p>
<p>You can <a href="http://www.barrydobson.com/download/LDAP-Demo" target="_blank">download this sample project</a> to check out some working examples.</p>
<p>If you have found the above article useful, have any comments or questions on it please leave a comment, and if you are a <a href="http://www.digg.com/" target="_blank">Digg</a> user, don&#8217;t forget to give it a Digg, thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.barrydobson.com/2008/06/13/working-with-ldap-in-vbnet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows Live Writer Plugin</title>
		<link>http://www.barrydobson.com/2008/06/09/windows-live-writer-plugin/</link>
		<comments>http://www.barrydobson.com/2008/06/09/windows-live-writer-plugin/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 14:44:11 +0000</pubDate>
		<dc:creator>Barry Dobson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WLW]]></category>

		<guid isPermaLink="false">http://www.barrydobson.com/2008/06/09/windows-live-writer-plugin/</guid>
		<description><![CDATA[
			
				
			
		
I have recently created my first Plugin for Windows Live Writer. I&#8217;m starting off simple with a Plugin that allows you to add Amazon affiliate links to your posts. It works with Amazons Quick Linker Widget which needs to first be added to your pages (in the footer).
I have submitted it the Windows Live Gallery, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.barrydobson.com%2F2008%2F06%2F09%2Fwindows-live-writer-plugin%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.barrydobson.com%2F2008%2F06%2F09%2Fwindows-live-writer-plugin%2F&amp;source=barrydobson&amp;style=normal&amp;service=bit.ly&amp;service_api=R_afcfcb0f75307325636188928ea62464" height="61" width="50" /><br />
			</a>
		</div>
<p>I have recently created my first Plugin for Windows Live Writer. I&#8217;m starting off simple with a Plugin that allows you to add Amazon affiliate links to your posts. It works with Amazons Quick Linker Widget which needs to first be added to your pages (in the footer).</p>
<p>I have submitted it the Windows Live Gallery, but I have no idea how long the submission process takes.</p>
<p>My Plugin and its details can be found <a href="http://www.barrydobson.com/software/amazon-quick-link-plugin/">here</a>.</p>
<p>Tags: <a rel="tag" href="http://technorati.com/tag/WLW">WLW</a> <a rel="tag" href="http://technorati.com/tag/Amazon">Amazon</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.barrydobson.com/2008/06/09/windows-live-writer-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AJAX Tutorials</title>
		<link>http://www.barrydobson.com/2008/05/22/ajax-tutorials/</link>
		<comments>http://www.barrydobson.com/2008/05/22/ajax-tutorials/#comments</comments>
		<pubDate>Thu, 22 May 2008 07:15:12 +0000</pubDate>
		<dc:creator>Barry Dobson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.barrydobson.com/2008/05/22/ajax-tutorials/</guid>
		<description><![CDATA[
			
				
			
		
I found this very good article that has links to 30 of the best AJAX tutorials around. It covers things from drag and drop to lists, as well as the basics of AJAX.
Designs Advice
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.barrydobson.com%2F2008%2F05%2F22%2Fajax-tutorials%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.barrydobson.com%2F2008%2F05%2F22%2Fajax-tutorials%2F&amp;source=barrydobson&amp;style=normal&amp;service=bit.ly&amp;service_api=R_afcfcb0f75307325636188928ea62464" height="61" width="50" /><br />
			</a>
		</div>
<p>I found this very good article that has links to 30 of the best AJAX tutorials around. It covers things from drag and drop to lists, as well as the basics of AJAX.</p>
<p><a href="http://designsadvice.com/ajax/30-of-the-best-ajax-tutorials/trackback" target="_blank">Designs Advice</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.barrydobson.com/2008/05/22/ajax-tutorials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>reCAPTCHA</title>
		<link>http://www.barrydobson.com/2008/01/07/recaptcha/</link>
		<comments>http://www.barrydobson.com/2008/01/07/recaptcha/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 13:12:02 +0000</pubDate>
		<dc:creator>Barry Dobson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.barrydobson.com/2008/01/07/recaptcha/</guid>
		<description><![CDATA[
			
				
			
		
I recently added a contact page to my site. To do this I used a wordpress plug in,&#160; Dagon Design. Its a very good plug in by the way. It allows you to prevent spam by adding a reCAPTCHA image to the form. I&#8217;ve always known about reCAPTCHA helping to digitise books where OCR is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.barrydobson.com%2F2008%2F01%2F07%2Frecaptcha%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.barrydobson.com%2F2008%2F01%2F07%2Frecaptcha%2F&amp;source=barrydobson&amp;style=normal&amp;service=bit.ly&amp;service_api=R_afcfcb0f75307325636188928ea62464" height="61" width="50" /><br />
			</a>
		</div>
<p>I recently added a <a href="http://www.barrydobson.com/contact">contact</a> page to my site. To do this I used a wordpress plug in,&#160; <a href="http://www.dagondesign.com/articles/secure-form-mailer-plugin-for-wordpress/">Dagon Design</a>. Its a very good plug in by the way. It allows you to prevent spam by adding a reCAPTCHA image to the form. I&#8217;ve always known about reCAPTCHA helping to digitise books where OCR is not working, but I have always wondered how the system knows you are correct, if the word cannot be read by computers. </p>
<p>After I signed up for my free account at <a href="http://recaptcha.net">recaptcha.net</a> I read about how it works.</p>
<blockquote><p>Each new word that cannot be read correctly by OCR is given to a user in conjunction with another word for which the answer is already known. The user is then asked to read both words. If they solve the one for which the answer is known, the system assumes their answer is correct for the new one. The system then gives the new image to a number of other people to determine, with higher confidence, whether the original answer was correct.</p>
</blockquote>
<p>You can read more about it <a href="http://recaptcha.net/learnmore.html">here</a>.</p>
<p>Tags: <a href="http://technorati.com/tag/reCAPTCHA" rel="tag">reCAPTCHA</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.barrydobson.com/2008/01/07/recaptcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System.DirectoryEntry &#8211; Adding new objects</title>
		<link>http://www.barrydobson.com/2007/09/03/systemdirectoryentry-adding-new-objects/</link>
		<comments>http://www.barrydobson.com/2007/09/03/systemdirectoryentry-adding-new-objects/#comments</comments>
		<pubDate>Mon, 03 Sep 2007 11:54:35 +0000</pubDate>
		<dc:creator>Barry Dobson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://www.barrydobson.com/?p=13</guid>
		<description><![CDATA[
			
				
			
		
I have recently been playing around with Apaches Directory Service, creating custom schema types and the like but came across a problem.
In VB.Net if I tried to add a new child to a directory entry, of a custom schema type (in this case in inherited from the person class) it would throw an exception when I tried to commit changes. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.barrydobson.com%2F2007%2F09%2F03%2Fsystemdirectoryentry-adding-new-objects%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.barrydobson.com%2F2007%2F09%2F03%2Fsystemdirectoryentry-adding-new-objects%2F&amp;source=barrydobson&amp;style=normal&amp;service=bit.ly&amp;service_api=R_afcfcb0f75307325636188928ea62464" height="61" width="50" /><br />
			</a>
		</div>
<p>I have recently been playing around with Apaches Directory Service, creating custom schema types and the like but came across a problem.</p>
<p>In VB.Net if I tried to add a new child to a directory entry, of a custom schema type (in this case in inherited from the person class) it would throw an exception when I tried to commit changes. On closer inspection I noticed that instead of creating an object of my custom schema class, it was trying to create an object of the person class, and the error being thrown by the LDAP server was because some of the properties I was trying to set did not exist for the Person class.</p>
<p>I managed to get around this by adding a property &#8216;objectClass&#8217; and setting the value to the type of my custom schema class. This means that when I call commit changes, the LDAP server can validate it against that class.</p>
<pre class="vb.net:nogutter">AddUpdateProperty(newUser, "objectClass", "myUserClass")
AddUpdateProperty(newUser, "mail", user.Email)
AddUpdateProperty(newUser, "uid", user.ID)</pre>
<p class="wlWriterSmartContent" style="display: inline; margin: 0px; padding: 0px">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/LDAP">LDAP</a>, <a rel="tag" href="http://technorati.com/tags/vb.net">vb.net</a>, <a rel="tag" href="http://technorati.com/tags/directoryentry">directoryentry</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.barrydobson.com/2007/09/03/systemdirectoryentry-adding-new-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System.DirectoryEntry Unknown error (0&#215;80005000)</title>
		<link>http://www.barrydobson.com/2007/08/31/systemdirectoryentry-unknown-error-0x80005000/</link>
		<comments>http://www.barrydobson.com/2007/08/31/systemdirectoryentry-unknown-error-0x80005000/#comments</comments>
		<pubDate>Fri, 31 Aug 2007 09:31:30 +0000</pubDate>
		<dc:creator>Barry Dobson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://www.barrydobson.com/?p=12</guid>
		<description><![CDATA[
			
				
			
		
I have recently encountered this really unhelpful error message in VB.Net whilst trying to code a connection to an LDAP server.
After much head banging I found the solution! It&#8217;s all down to the path you supply to the constructor:
Old Connection (doesn&#8217;t work):
Using dir As New DirectoryEntry(ldap://yourserver:port)
	' Your Code
End Using
New Connection (does work):
Using dir As New [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.barrydobson.com%2F2007%2F08%2F31%2Fsystemdirectoryentry-unknown-error-0x80005000%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.barrydobson.com%2F2007%2F08%2F31%2Fsystemdirectoryentry-unknown-error-0x80005000%2F&amp;source=barrydobson&amp;style=normal&amp;service=bit.ly&amp;service_api=R_afcfcb0f75307325636188928ea62464" height="61" width="50" /><br />
			</a>
		</div>
<p>I have recently encountered this really unhelpful error message in VB.Net whilst trying to code a connection to an LDAP server.</p>
<p>After much head banging I found the solution! It&#8217;s all down to the path you supply to the constructor:</p>
<p>Old Connection (doesn&#8217;t work):</p>
<pre class="vb.net:nogutter">Using dir As New DirectoryEntry(ldap://yourserver:port)
	' Your Code
End Using</pre>
<p>New Connection (does work):</p>
<pre class="vb.net:nogutter">Using dir As New DirectoryEntry(LDAP://yourserver:port)
	' Your Code
End Using</pre>
<p>Spot the difference? That&#8217;s right! the protocol part (LDAP) is case sensitive. Changing to uppercase works like a charm.</p>
<p>Update: I have posted an article and sample code on working with LDAP <a href="http://www.barrydobson.com/2008/06/13/working-with-ldap-in-vbnet/">here</a>.</p>
<p class="wlWriterSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/vb.net">vb.net</a>, <a rel="tag" href="http://technorati.com/tags/directoryentry">directoryentry</a>, <a rel="tag" href="http://technorati.com/tags/unknown%20error">unknown error</a>, <a rel="tag" href="http://technorati.com/tags/ldap">ldap</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.barrydobson.com/2007/08/31/systemdirectoryentry-unknown-error-0x80005000/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
