weblogs.com.pk

Proud To Be Pakistanis!
Welcome to weblogs.com.pk Sign in | Join | Help
in Search

Adeel bin Khalid

"When a Man's Education is Finished; He is finished"

  • Microsoft Source Code Analyzer for SQL Injection

    In response to the recent mass SQL injection attacks, Microsoft has developed a new static code analysis tool for finding SQL Injection vulnerabilities in ASP code. Web developers can run the tool on their ASP source code to identify the root cause of the attack and address them to reduce their exposure to future attacks. The tool will scan ASP source code and generate warnings related to first order and second order SQL Injection vulnerabilities. The tool also provides annotation support that can be used to improve the analysis of the code.

    Free Download

  • Programmatically Convert a Paragraph Text to JPG - C#

    Use the following code to convert a paragraph to a JPG image

    Color FontColor = Color.Black;
    Color BackColor = Color.White;
    string FontName = "Verdana";
    int FontSize = 36;
    string Text = "Hello this is a sample text and will be converted in to JPG Hello this is a sample text and will be converted in to JPG sample text will";
    int imgHeight = 1700;
    int imgWidth = 1700;

    try
    {
    //Create a Bitmap object with the Width and Height specified earlier
    Bitmap objBitmap = new Bitmap(imgWidth, imgHeight);

    //Create a Graphics object using this Bitmap object.
    Graphics objGraphics = Graphics.FromImage(objBitmap);

    //Create Color, Font, and PointF objects.
    Font objFont = new Font(FontName, FontSize, FontStyle.Bold);

    //Create two SolidBrush type objects.
    SolidBrush objBrushForeColor = new SolidBrush(FontColor);
    SolidBrush objBrushBackColor =
    new SolidBrush(BackColor);

     

    //Create a Rectangle to fit the text in
    Rectangle imgRectangl = new Rectangle(0, 0, imgWidth, imgHeight);

    //Draw rectangle using Graphics object and fill it with BackColor.
    objGraphics.FillRectangle(objBrushBackColor, 0, 0, imgWidth, imgHeight);

    StringFormat strFormat = (StringFormat) StringFormat.GenericTypographic.Clone();

    //Horizontal Allignment
    strFormat.Alignment = StringAlignment.Center;

    //Vertical Allignment
    strFormat.LineAlignment = StringAlignment.Center;

    //Draw Text string on the specified rectangle using Graphics object.
    objGraphics.DrawString(Text, objFont, objBrushForeColor, imgRectangl, strFormat);

    //Save the file on the disk
    objBitmap.Save(@"C:\abc.jpg", ImageFormat.Jpeg);
    }

    catch(System.Exception ex)
    {
    MessageBox.Show(ex.Message);
    }

  • Programming MOSS

    Getting married was easy but getting time to study something after marriage is not that easy Smile

    Development for SharePoint has always been in my "Goals to Achieve" list and I have waited long for a project to come where I get the chance to explore and work in Sharepoint. But I think now is the time when I should stop waiting and start learning and exploring Microsoft Office SharePoint Server(MOSS) by myself. I have started reading Microsoft Sharepoint 2007 Development Unleashed 

    I am reading Chapter 3 and I think so far the author has explained the things pretty good. Lets see when would I be able to finish this book Hmm

    If anyone knows a better book or some good online vidz related to MOSS Development, please let me know.

  • FileNet Content Engine: Change the value of an attribute of a folder on its creation

    Last month brought lot of new things to my life. I came back from Islamabad after spending 5 months (18/7) on client side. We worked like hell there. And on 31st of March I got married :).. thanks :).. and this is something I’ve been thinking form the day I got married that how people get time for their studies after getting married :).. any comment from married readers would be really appreciated :)..

    And finally this is a VBScript snippet, used in FileNet CE, I have written to change the property value of a folder on its creation. This code is used on a subscription event and changes the value of an attribute of a folder as soon as the folder is created

    Public Sub OnEvent (EventObject, Subscription)
        dim oSource , os
        Const idmObjTypeFolder = 2
        set os = EventObject.ObjectStore
        set oSource = os.GetObject(idmObjTypeFolder,EventObject.SourceObjectId)
        oSource.SetValue "ObjectStoreName", Ucase(os.Name)
        oSource.Save
    End Sub 

     

  • Embedded Resource + Microsoft.VisualBasic.Devices Namespace

    I always prefer to develop some lil utilities to make lot of people's life easy, including myself </smile>... For instance I have developed a utility to create backup of sharepoint's sites. And some other utilities like creating insert queries scripts for data in a table, arranging and putting "& _ " in strings of huge SQL queries, and so on..

    Sometimes there is a need to add some supportive files to these utilities. There are different techniques to do this but the one is use quite often is that I embed the file in the assembly and at runtime I get it out from the assembly and use it as required. For example in case of creating site backups of sharepoint, a file "stsadm.exe" is required which does all the job. so I include the file in my project and set the Build Action property to Embedded Resource. Then later use the following code to get it out from the assembly.

    Dim Strm As IO.Stream
       
    Dim Buffer() As Byte
        If
    Not My.Computer.FileSystem.FileExists(filename) Then
        Strm = System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream(Root Namespace.filename)
        ReDim Buffer(Strm.Length)
        Strm.Read(Buffer, 0, Buffer.Length)
        Strm.Close()
        My.Computer.FileSystem.WriteAllBytes(filename, Buffer,
    False)
        Buffer =
    Nothing
        End If

    There is a new property introduced in VS2005, Copy to Output Directory. You can set the property according to you need.

    And hay has anyone checked the new namespace, Microsoft.VisualBasic.Devices, added in 2.0?? In the code above I have used it couple of time. My.Computer.FileSystem.FileExists and My.Computer.FileSystem.WriteAllBytes. Try it, it got some good stuff to explore.

  • Adding Custom Fields to Search Dialog of MS Outlook

    The default Search Dialog of Microsoft Outlook looks as follows

    In this post I will add an additional field in the search dialog. This field can be a field that already exists in active directory or can be an MS Exchange Extension Attribute.

    To change this window, first go to the Exchange System Manager. It is located on the machine where exchange server is installed. Drill down to the following location

    If you check the properties of Search Dialog you will see all the attributes available on the search contact window. Here you can remove fields which are not required and add your custom fields or relevant fields.

    Here you can change the X,Y position, length, width, height and the multiline property of the fields.

    Now if you go and check the search window, a new field will be displayed there. Now the million dollars question, how to populate this field? If someone wants to use the default UI of AD for population these additional fields, he will have to write an extended UI for AD using VC++ or C++. However if you don’t wana do that then create users programmatically and populate you required fields. The catch to this method is that your AD admin will not be able to view these fields using AD UI.

  • Browser Extensions Overviews and Tutorials + Building Secure ASP.NET Apps

    Guys if you are interested in extending IE then you must read this tutorial. For last few days I am in Islamabad (the city I don’t like at all) so unfortunately I couldn't get the chance to try it but I know I’ll have one hell of a time with this baby so as soon as I go back to Lahore, this is gonna be the first thing I'll be doing </smile>yes right.. extending my browser</smile>

    Its been continuous raining here for last couple of days and the weather out there is awesome. Water level is raising in Nala Laie and people here say that they haven’t seen this much water in Nala Laie for quite sometime. But still the weather here is something you don’t get in Lahore. Hay sweetie I wish you were here</smile> missing you a lot. aheem aheem

    In addition to Khurram bhai’s list of books, Building Secure ASP.NET Applications--Authentication, Authorization, and Secure Communication is a book one should go through. Man this book is all about security and the good news is you don’t have to buy it, its available for free in PDF format</smile>

  • FileNet Connectors for Microsoft SharePoint

    With FileNet Connectors for Microsoft SharePoint, business users can stay in the familiar Microsoft Office environment for the majority of their daily document-based activities while integrating with the ECM capabilities of FileNet’s P8 platform. The connectors provide a powerful content, process and compliance infrastructure to ensure SharePoint activities are accessible to authorized users and placed under full lifecycle and compliance management.

  • Made In Express Contest

    The Made In Express contest is your chance to shine and win $10,000 in prizes by building a cool, fun project using Visual Studio and SQL Server Express. To enter, just submit your idea.

    Its a little late to participate in the contest but do checkout the ideas submitted by the others.

  • its been quite sometime!!

    For last couple of months or so, i have been working like anything.. not doing much of the .net stuff and missing the old good days when i used to write lot of .net code.. and I dont have much to post. infect i have opened my weblogs account after a long time. its nice to see lot of good changes around. lot of new features like the photo section. thanks god now i dont have to manage another account to place my blogs pics on some abc site..

    Nowadays, most of the time i am working on FileNet ECM.. writting lot of server side vb scripts and exploring BPM, Document Capturing (Conversion of physical documents to electronic form) and stuff like that. Few days back i got the chance to explore Atlas. man its good. lets see when do we get the change to implement it in some real project... my company is little lazy when it comes to go for a new technology... our .net teams are still working in VS2003.. i think only fahad's team is using asp.net 2.0....

    and hay fahad!! when u get some offer from Middle East, do let me know </smile>

    i'll be back.......... yeah right </smile>

  • Pakistan 'is a top failed state'

  • Ajax.NET now OpenSource

    Michael Schwarz: has turned his Ajax.NET library into an OpenSource project going under the handle of "BorgWorX Control Suite".

    Michael Schwarz:
    The development of the Ajax.NET library has been stopped. On my private time I'm still developing on an AJAX library for the Microsoft .NET Framework. You can download my latest library here, it is called Ajax.NET Professional, now. BorgWorX is developing a commercial Ajax.NET library that is using the latest sourc code of the Ajax.NET library. The BorgWorX Ajax.NET version is an open source project and includes web controls that are using AJAX methods to update itself.

    check this example page its kewl....

  • Capture Process in FileNet Capture Professional

    In simple words, capture is a process to convert physical documents into electronic form using a scannner, fax machine or using simple file import option. Capture Professional is a desktop based application provided by FileNet for this purpose . The typical steps a FileNet Capture based solution has Acquisition, Image Processing, Assembly, indexing and Committal. Below is the detail of each process.

    Acquisition/Scan: Images can be acquired from scanners or imported from the file system. Multiple images sources and scan stations can be used in the same Capture System.

    Verify Image: This process makes sure that the quality of scanned image is as good as the original document. If the quality does not meet the expectations, it is rejected and sent for rescanning.

    Image Processing: Image processing is provided by tools that enhance images, detect blank pages, and spot–check images to ensure image quality. FileNet Capture’s images processing capabilities include barcode and patchcode recognition.

    Assembly: Assembly is the process of grouping individual pages into documents, a process like collating.

    Indexing: Indexing is the process of assigning retrieval values to documents, so that they can later be located in the database. The process is similar to labeling items before they are stored so they can be easily identified later.

    Verify Indexing: Verify Indexing is the process of assuring that right values against a document has been entered in the Indexing phase.

    Committal: Committal is the process of writing the complete documents to a FileNet server (Content Engine or Image Server), where they will become available to users enterprise wide.

  • Banned Xbox 360 Ad: Best Ad Ever

  • Deciding When to Deploy WSS and SPS

    I come across this question a lot "whether I should deploy Windows SharePoint Services by itself or with SharePoint Portal Server 2003?". A white paper published by Mircosoft explains it all.

More Posts Next page »
Powered by Community Server (Personal Edition), by Telligent Systems