RBM Binary Image now displays barcode using Code39

December 11, 2009 · Posted by Ramy Mostafa · Posted in .NET, ASP.NET, C# · Comment 

RBMBinaryImage Source Code

Introduction

It’s been a while since I lost wrote on my blog yesterday one of my friends was asking me how to display Barcode in asp.net, There is a great open source code written by Bart De Smet which could return a bar code image from a bar code string you could see his article here I have just added to it one small option of whether or not to display the code under the bar code. The library returns an Image I thought of adding the display of bar code from the bar code string value, functionality to RBMBinaryImage would be cool.

RbmBinaryImageBarCode

Bar Code and Binary Image Screen shot

Using the Code

The idea was simple since, the Code39 Library returns already an Image object so I only got it’s bytes and passed it to the ImageContent Property which is then rendered in the image. for more information on how the binary image display works in RBMBinaryImage please visit the post here. Again the usage of the control is still easy, to display the bar code you only need to set the PrintBarcode property to true, and pass the BarCodeValue the bar code as you could see below the DisplayThumbnail Property still is being applied on the bar code.

<Rbm:RbmBinaryImage ID="RbmBinaryImage2" runat="server" PrintBarcode="true"  BarCodeValue='<%# Eval("BarCode") %>' DisplayThumbnail="true"   ThumbnailSize="160"  EmptyImageUrl="images/NoPhoto.JPG" />

I have made one change to the HttpHandler to be with the extension of the .ashx instead of the .rbm extension to be standard

<httpHandlers>
<add verb="GET" path="__RbmImageHandler.ashx" type="RbmControls.RbmImageHandler"/>
</httpHandlers>

Finally, you could find the code here

Uninstall Previous Version of .NET Application Automatically

July 18, 2009 · Posted by Ramy Mostafa · Posted in .NET, C#, Visual Studio · 2 Comments 
To uninstall a previous version of a .net application automatically while installing the new version. you only need to set the RemovePreviousVersions to true and update the program version. This could be find in the properties of the setup project. check the screenshot below for demonestration uninstall

Rbm Visual Studio Eye Friendly DarkTheme

April 23, 2009 · Posted by Ramy Mostafa · Posted in Visual Studio · 2 Comments 

Rbm-DarkTheme.zip

Introduction

Recently I have passed through a very cool Theme For Visual Studio 2008 it’s called TaznimSaqib-DarkTheme I found it a very nice theme indeed and very comforting for my eyes so since I use Both Visual Studio 2008 and Visual Studio 2005 I decided to make a similar one for Visual Studio 2005. you could find a screenshot to the theme below

screenshotcode

Setting the Theme in Visual Studio

For setting the theme click on tools -> Import and Export

Then select Import Selected Environment Settings, In the next page select save my current settings and press next. Then browser for the settings file that you could download from above. Then select next then finish.

Hope you enjoy the theme and you find it cool to use. Share your thoughts :)

Running Fiddler on LocalHost

April 20, 2009 · Posted by Ramy Mostafa · Posted in Fiddler · Comment 

Fiddler is an awesome tool for Web Debugging which logs all HTTP(S) traffic between your computer and the Internet. To run fiddler on your localhost you could simply place a “.” after the localhost e.g. http://localhost:4433/MySite/ => http://localhost.:4433/MySite/ Notice the “.” after localhost however sometimes this doesn’t work on vista so you could try either putting your computer name instead of localhost or the loop back IP e.g http://127.0.0.1.:4433/MySite The “.” is still there after the IP.

Hope you enjoy it, please share your thoughts

Deploying Custom Tool using a Setup Project

April 8, 2009 · Posted by Ramy Mostafa · Posted in .NET, ASP.NET, C# · 3 Comments 

CustomToolDeploymentForVisualStudio.zip

Introduction

Making a custom tool work on the developers machine require several actions like placing keys in the registry and registering your DLL Library using the regasm command. This post will discuss the automation of this procedures using a setup project. for more information on making your own custom tool visit my post Building a Custom Tool Generator For Visual Studio

Using the Code

First add a class in your CustomTool Library Project that inherits from the Installer class in this class override two methods the first is the Install Method the Second is the Uninstall method.

To Get the regasm.exe path you could use the InteropServices.RuntimeEnvironment class to get the runtime directory of the .NET framework. Then you need to get the assembly location. After that you could simply start the process of the regasm and pass to it the /codebase parameter and the path of the library.

public override void Install(System.Collections.IDictionary stateSaver)
{
    base.Install(stateSaver);
    string regasmPath = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + @"regasm.exe";
    string componentPath = base.GetType().Assembly.Location;
    System.Diagnostics.Process.Start(regasmPath, "/codebase \"" + componentPath + "\"");
}

To uninstall remove the component registeration by the /unregister parameter

public override void Uninstall(System.Collections.IDictionary savedState)
{
    base.Uninstall(savedState);
    string regasmPath = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + @"regasm.exe";
    string componentPath = base.GetType().Assembly.Location;
    System.Diagnostics.Process.Start(regasmPath, "/unregister \"" + componentPath + "\"");
}

The Setup Project

Now make a new setup project and add the output of the CustomTool Library to it. Then Right Click the setup project and select view then select custom actions.
customactions2
Then Add the CustomTool Project Output to the Install and Uninstall Sections as in the image below.
customtoolsetup
ok now you need to add the registry values right click on the setup project and then View then select Registry To add the Needed Registry Values follow the structure in the figure below.
customtoolregistry

Share your Thoughts

Now all you have to do is just build the setup project :) and you will have a setup deployment for your custom tool.
please share your thoughts and feel free to drop any comments. Hope you enjoy the project.

Next Page »

























































download movies

ñêà÷àòü ôèëüìû