Sunday, September 15, 2013

ClickOnce Deployment

Introduction

We are very much aware of Windows installer, there  are many drawbacks which a developer faces with Windows installers as Updating the application, administrative permission problem, impact to the users computer
ClickOnce is a deployment technique that enables you to create self-updating Windows-based applications that can be installed and run with minimal user interaction.

Click one deployment Advantage:

a.    Self updating windows based application.

b.    Windows installer requires administrative permission for installation. ClickOnce deployment enables non-administrative users to install and grants only those Code Access Security permissions necessary for the application.

c.    Low impact to the user computer: In the windows installer application often relay on shared component, with the potential for versioning conflicts; with ClickOnce deployment, each application is self-contained and cannot interfere with other applications.

Any Windows Presentation Foundation, Windows Forms, or Console Application published using ClickOnce technology is ClickOnce Application.

ClickOnce application can be publish in three different ways:
a.    From a web page
b.    From a network file share
c.    From  a media such as CD-ROM

Key feature of ClickOnce Deployment

a.    ClickOnce application can be installed on an end user's computer and run locally even when the computer is offline, or it can be run in an online-only mode without permanently installing anything on the end user's computer.
b.    ClickOnce applications can be self-updating; they can check for newer versions as they become available and automatically replace any updated files. The developer can specify the update behavior; a network administrator can also control update strategies, for example, marking an update as mandatory. Updates can also be rolled back to an earlier version by the end user or by an administrator.
c.    ClickOnce applications are isolated, installing or running a ClickOnce application cannot break existing applications. ClickOnce applications are self-contained; each ClickOnce application is installed to and run from a secure per-user, per-application cache. ClickOnce applications run in the Internet or Intranet security zones. If necessary, the application can request elevated security permissions.

Steps to work with ClickOnce Deployment
•    Publishing ClickOnce Deployment
•    Deploying ClickOnce Applications
•    Installing ClickOnce Applications
•    Updating ClickOnce Application
The ClickOnce Technology depends on two XML manifest files; An Application manifest and a deployment manifest. The files are used to describe where the ClickOnce applications are installed from, how they are updated, and when they are updated.

Wednesday, September 4, 2013

Get the List of Active Directory Users in C#

The below code will fetch the list of users form active directory.

Code Download

1)  Include the namespace System.DirectoryServices in the page.
  
using System;
using System.Collections.Generic;
using System.DirectoryServices;
using System.Linq;
using System.Windows.Forms;



The System.DirectoryServices namespace provides easy access to Active Directory Domain Services from managed code. The namespace contains two component classes, DirectoryEntry and DirectorySearcher, which use the Active Directory Services Interfaces (ADSI) technology.


2) Below code will fetch the uses from given domain name

  public class AllUsers
    {
        public List<string> GetUser(string domainName)
        {
            return DirectoryIdentity("LDAP://" + domainName);
        }
        private List<string> DirectoryIdentity(string path)
        {
            DirectoryEntry directoryEntry1 = new DirectoryEntry(path);
            try
            {
                //ArrayList allUsers = new ArrayList();
                List<string> allUsers = new List<string>();
                DirectorySearcher AllUsers = new DirectorySearcher(directoryEntry1);
                AllUsers.PropertiesToLoad.Add("sn");  // surname = last name
                AllUsers.PropertiesToLoad.Add("givenName");  // given (or first) name
                AllUsers.PropertiesToLoad.Add("mail");  // e-mail addresse
                AllUsers.PropertiesToLoad.Add("userPrincipalName");  // user logon name
                AllUsers.PropertiesToLoad.Add("cn");
                AllUsers.SearchScope = SearchScope.Subtree;
                AllUsers.Filter = "(&(objectClass=user)(objectCategory=person))";
                AllUsers.PropertiesToLoad.Add("samaccountname");
                int count = AllUsers.FindAll().Count;
                SearchResultCollection results = AllUsers.FindAll();
                SearchResult result;
                if (results != null)
                {
                    for (int counter = 0; counter < results.Count; counter++)
                    {
                        result = results[counter];
                        if (result.Properties.Contains("samaccountname"))
                        {
                            allUsers.Add((String)result.Properties["samaccountname"][0]);
                        }
                    }
                }
                allUsers = allUsers.OrderBy(x => x).ToList();
                return allUsers;
            }
            catch
            {
                throw;
            }
        }
    }



3) You can pass the domain name as below code in the windos applicaion

 private void btnClick_Click(object sender, System.EventArgs e)
        {
            string domainName = txtDomianName.Text.Trim();
            if (string.IsNullOrEmpty(domainName))
            {
                MessageBox.Show("Domain name can not be blank.");
                return;
            }
            AllUsers allUser = new AllUsers();
            List<string> userList = allUser.GetUser(domainName);
            cbUser.DataSource = userList;
        } 


Tuesday, September 3, 2013

Wireframe and Mockup Tools

wireframe is very important part of your developemnt process. it is a visualization part for represeting the proposed functions, structure and content of UI. it can be understand as bule print of page.
In other words wireframe is the page layout or arrangement of page content.

The purpose of wireframe to create the idea of business process of module in to mockup UI screens before actual developent.


A wireframe can contain:
1) Page elements, Header,Footer
2) Location of elements.
3) Navigations
4) Content objects.
5) Grouping of elemtns
6) Action buttons.

Some Wireframe creation tools:

Balsamiq Mockups

Lumzy – Quick Mockup Creation and Prototyping Tool

Mockup Builder – A Killing Prototyping App

Tiggr – Creating Prototypes Collaboratively

Frame Box – Lightweight Online Tool for Creating Mockups

SimpleDiagrams Free Edition (Adobe Air App)

iPhone Mockup

fluidIA

Pencil Project (Firefox Extension)

CogTool – General Purpose UI Prototyping Tool (Standalone Application for Win & Mac)

Prototype Composer (Community Edition)

DUB – DENIM (Standalone Application for Win, Linux & Mac)