Thursday, August 20, 2009

Finding the failed feature-id in MOSS 2007

List featIDs = new List();
foreach (SPFeatureDefinition featdef in SPFarm.Local.FeatureDefinitions)
{
try
{
//db5c27c4-6f17-4296-bc05-bbe9978284b4
if (featdef.DisplayName.Contains("manoj"))
{
Console.WriteLine("{0}: {1}", featdef.Id, featdef.DisplayName);
break;
}
}
catch
{
//This code will be executed if the feature does not have the manifest file.
Console.WriteLine("################################################");
Console.WriteLine("Error Ocurrred! Attempting to get feature ID of the feature without manifest file...:");
Console.WriteLine(featdef.Id.ToString());
}

Friday, August 14, 2009

Content Types and Workflows

  • Workflows can be associated with content Type
  • Workflow tasks are special content type(0x010801)
  • Content types can have special new, display and edit forms.
  • Therfore, the task edit page for a workflow task can be customized
  • Thursday, August 6, 2009

    Finding MAC address in VB.Net

    Imports System.Management
    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim mc As System.Management.ManagementClass
    Dim mo As ManagementObject
    mc = New ManagementClass("Win32_NetworkAdapterConfiguration")
    Dim moc As ManagementObjectCollection = mc.GetInstances()
    For Each mo In moc
    If mo.Item("IPEnabled") = True Then
    ListBox1.Items.Add("MAC address " & mo.Item("MacAddress").ToString())
    End If
    Next
    End Sub
    End Class