Every one who has ever developed a .NET project would know how to get to the GAC simply by: Start -> Run -> C:\windows\assembly\

But what most people don’t know is how to get to the internal folders with ease, there are a number of ways and the one stated below works well for copying config \ resource files next to the actual Dlls.

First Method:

Start -> Run -> C:\windows\assembly\gac_msil

This should bring up the internal folders in the Global Assembly Cache and you can easily drag drop items in there.

Second Method :

In .net application we need to have a copy of a dll which is available in GAC. But when we view the GAC through C:\Windows\assembly folder it will show like this



Using this we cannot copy the dll. Only uninstall option is available.

To view the available dll using the naked eye follow the steps

Dot net have a dll file Shfusion.dll which is a Assembly Cache Viewer. It is located in the following path.

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

1.uninstall the dll using the following command in the run dialog box.
regsvr32 -u C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

1.Now type assembly in the Run dialog box.
2.Now you will see the folder view of the GAC. copy the dll you want.



Note:

To get back to the previous state of view register the Shfusion dll using the following command

regsvr32 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

Category : | Read More......

Add the Namespace

"using System.EnterpriseServices.Internal;"


String SourceLocation = ConfigurationManager.AppSettings["SourceDLL"].ToString();
if (Directory.Exists(SourceLocation))
{
foreach(String sFileName in Directory.GetFiles(SourceLocation))
{
FileInfo FileName = new FileInfo(sFileName);

Publish oPublish = new Publish();

//To Remove the DLL in assembly
oPublish.GacRemove(SourceLocation + "\\" + FileName.Name.ToString());

//To Install the DLL in assembly
oPublish.GacInstall(SourceLocation + "\\" + FileName.Name.ToString());
}
}


There is no need to remove the dll seperately as mentioned in the code, it can be automatically overwritten.

Category : | Read More......

Add the Referece for the project - ionic.utils.zip.dll
Add the Namespace using Ionic.Utils.Zip;


String SourLocation = String.Empty;
String DestLocation = String.Empty;

protected void Page_Load(object sender, EventArgs e)
{
try
{
SourLocation = ConfigurationManager.AppSettings["SourceLocation"].ToString();
DestLocation = ConfigurationManager.AppSettings["TargetLocation"].ToString();
}
catch (Exception ex)
{ }
}

protected void btnCreate_Click(object sender, EventArgs e)
{
ZipFile oSourceZip = null;
try
{
oSourceZip = new ZipFile(ConfigurationManager.AppSettings["SourceZip"].ToString());

if (Directory.Exists(SourLocation))
{
if (Directory.GetDirectories(SourLocation).Length > 0)
{
foreach (String sDirectory in Directory.GetDirectories(SourLocation))
{
oSourceZip.AddDirectory(sDirectory, sDirectory.Substring(sDirectory.LastIndexOf("\\") + 1));
}
}
if (Directory.GetFiles(SourLocation).Length > 0)
{
foreach (String sfileName in Directory.GetFiles(SourLocation))
{
oSourceZip.AddFile(sfileName, "");
}
}
oSourceZip.Save();
}
}
catch (Exception ex){ }
}

Category : | Read More......

String Properties and Methods :

In JavaScript, there are two types of string data types: primitive strings and String objects. String objects have many methods for manipulating and parsing strings of text. Because these methods are available to primitive strings as well, in practice, there is no need to differentiate between the two types of strings.
Some common string properties and methods are shown below.

In all the examples, the variable MY_STRING contains "Webucator".

Java Script Event Handler :

Create an aspx button :
asp:button text="Click Me" runat="server"

In the server side add the button client side functions.

btnOpen.Attributes.Add("onClick", "return false;");
btnOpen.Attributes.Add("onMouseOver", "mousemoveover();");


Javascript function to move the button

function mousemoveover()
{
var btn = document.getElementById("btnOpen");
var sHeight = screen.height - 400;
var sWidth = screen.width - 100;
btn.style.marginLeft = Math.floor(Math.random()*sWidth) + 'px';
btn.style.marginTop = Math.floor(Math.random()*sHeight) + 'px';
}