The majority of custom applications require security with users, roles, etc. well DotNetNuke is the perfect structure for writing custom applications. Why? you say, well Imagine having a tool which will allow for forms, windows, or LDAP authentication and an impeccable infrastructure for roles/groups allowing module-level security, that's right, not just page level but module level security. Also, DotNetNuke 4 supports ASP.NET 1.1 and 2.0 so you can easily re-use your code without re-inventing the wheel.
In this article I am going to show how, as a .net developer, you can use any .NET language to create custom applications using the DotNetNuke framework by accessing the two basic necessities in any custom application: username and role.
Assumptions:
You know how to create user controls in ASP.NET 2.0 and/or 1.1
Resources:
Article:
Step1. Create a UserControl in your project/website:

Step2. Add a Label to the UserControl:

Step 2a. Add a Reference to the “DotNetNuke.dll”
Step3. Now copy and paste this code into your usercontrols Page_Load Procedure (this is in VB.NET)
Dim mRoles As New DotNetNuke.Entities.Users.OnlineUserInfo
Dim mUserRoles As New DotNetNuke.Security.Roles.RoleController
Dim mUser As DotNetNuke.Entities.Users.UserInfo = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo
Dim showroles As String = ""
For Each i As String In mUserRoles.GetRolesByUser(mUser.UserID, mRoles.PortalID)
showroles += i.ToString() & ","
Next
Me.Label1.Text = "UserName: " & mUser.Username
Me.Label1.Text += "<br> FullName: " & mUser.FullName
Me.Label1.Text += "<br> UserID: " & mRoles.UserID.ToString
Me.Label1.Text += "<br> Roles: " & showroles
Step5. Load SmartDNNModule into your portal (follow the instructions that comes with smartdnnmodule)
Step6. Add SmartDNNModule onto a Page
Step7. In the Two Text Boxes type in: “WebUserControl.ascx” then click “Create Module”
Step8. Login in as a user
Step9. Click on the page where you loaded SmartDNNModule
Step10. You now know how to access everything to create a custom application (by exploring the classes that I have shown, you will reveal many useful functions and procedures in the DotNetNuke framework):

About the Author:
Charles Stratton has been programming since 1999 and enjoys staying on the edge of technology. his skills range from DNN to Sharepoint to Custom Development. currently working in VB.Net and C#.Net web and software. KISS - Programmers work smarter not harder. Charles can be reached at stratcr@peoplepc.com.