Friday, October 10, 2008

Read/Modify Application Configuration .config file

Read
string value = ConfigurationManager.AppSettings["oldPlace"];

Write

System.Configuration.Configuration config =ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

config.AppSettings.Settings["oldPlace"].Value = "3";
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");

Thursday, September 11, 2008

Add On - Integrating Browser & Outlook

Browser add on to provide capabilities to use outlook stored information like contacts, emails etc without leaving the browser.

get contact mail address
attach mails from outlook to email in browser

Thursday, August 21, 2008

Enable Maintainanace plan for SQL Server 2005

run the script:

use msdb
GO
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Agent XPs', 1;
GO
RECONFIGURE
GO

go to maintainance plan to see details about how to create them

Wednesday, August 13, 2008

SMMS - Short Message Mailing System

SMMS i.e. Short Message Mailing System

A system which provides the feature of a mailing system like (address, lists, reply, forward etc) based on SMS.

Additionally it can have a feature where a person can expose a contact list to someone he know, without the other person being aware of who all are the contact list(acting as a middle man).

This can be a faster, reliable and social way to make people aware of  things going on.

 

Monday, August 11, 2008

Windows vista security - rendered useless by researchers

LAS VEGAS -- Two security researchers have developed a new technique that essentially bypasses all of the memory protection safeguards in the Windows Vista operating system, an advance that many in the security community say will have far-reaching implications not only for Microsoft, but also on how the entire technology industry thinks about attacks.

In a presentation at the Black Hat briefings, Mark Dowd of IBM Internet Security Systems (ISS) and Alexander Sotirov of VMware Inc. discussed the new methods they've found to get around Vista Protections such as Address Space Layout Randomization (ASLR), Data Execution Prevention (DEP) and others by using Java, ActiveX controls and .NET objects to load arbitrary content into Web browsers.

By taking advantage of the way that browsers, specifically Internet Explorer, handle active scripting and .NET objects, the pair have been able to load essentially whatever content they want into a location of their choice on a user's machine.

http://searchsecurity.techtarget.com/news/article/0,289142,sid14_gci1324395,00.html

 

Thursday, July 31, 2008

Image Decoder

An application which can add images to its collection as a encoded serialized bit.

Features
- add images files as encoded bits
- display images (encoded bits)

useful to hide what images you have because it can only be viewed by your own application

Friday, May 9, 2008

ICollection & IEnumerator

ICollection inerface is used to make a custom collection type.
Function which must be used are - Add, Clear, Count, GetEnumerator
IEnumerator interface is used to enumerator through a collection.
Functions which must be used are - MoveNext, Current, Reset

The example below is the most basic and is used to create a string - string collection where each item in second list is dependent upon the item in the first list at the same index position.

Example

Collection class

public class CustomCollection : ICollection
{
List customMainList = new List();
List customDependentList = new List();


public virtual void Add(string x, string y)
{
customDependentList.Add(y);
customMainList.Add(x);
}

public virtual void Clear()
{
customMainList.Clear();
customDependentList.Clear();
}

#region ICollection Members

public void CopyTo(Array array, int index)
{
throw new Exception("The method or operation is not implemented.");
}

public int Count
{
get { return customMainList.Count; }
}

public bool IsSynchronized
{
get { throw new Exception("The method or operation is not implemented."); }
}

public object SyncRoot
{
get { throw new Exception("The method or operation is not implemented."); }
}

#endregion

#region IEnumerable Members

public IEnumerator GetEnumerator()
{
return new CustomCollectionEnumerator(customMainList, customDependentList);
}

#endregion
}


Enumerator for collection class

public class CustomCollectionEnumerator : IEnumerator
{
List customMainList = null;
List customDependent = null;
int position = -1;

public CustomCollectionEnumerator(List main, List dep)
{
customMainList = main;
customDependent = dep;
}

#region IEnumerator Members

public object Current
{
get { return new KeyValuePair(customMainList[position], customDependent[position]); }
}

public bool MoveNext()
{
position++;
return (position < customMainList.Count);
}

public void Reset()
{
position = -1;
}

#endregion
}


Used in a program


CustomCollection cus = new CustomCollection();
cus.Add("wts1", "admin");
cus.Add("wts1", "suzie");
cus.Add("wts2", "admin");
cus.Add("wts3", "sally");
cus.Add("wts2", "dam");
foreach (KeyValuePair pair in cus)
{
Console.WriteLine(pair.Key + " : " + pair.Value);
}
Console.ReadKey();