Sunday, December 21, 2008

AppV softgrid

I'm currently evaluating this product.
Useful tools:
Sft tool - great tool provides a look into internal structure of package

Tuesday, February 12, 2008

Unsupported encoding of VC 2.5

After upgrade to 2.5, I discovered that i can't start vmware virtual center. I checked the event viewer and found the following message:
The VMware Infrastructure Web Access service terminated unexpectedly , error number 7031.

After playing a lot with tomcat5 - i found out that it crashes on unsupported code page. In my case cp1255....

so i changed it to "ENGLISH (united states)" and this solved the problem
in case and this doesn't help - check the logs in this directory:

C:\Program Files\VMware\Infrastructure\VirtualCenter Server\tomcat\logs

Monday, January 28, 2008

C# accessing to fields/object by string

string vStringUnFiltered = Class.GetType().GetField(method_in).GetValue(Class_instance).ToString();

Regex + C# parsing IP into segments a.b.c.d to a./a.b./a.b.c

One of intresting features at C# .NET is Regular Expressions which is very handy and save time (similiar to perl style). It's possible to assign values to search items. Small example is:
void main()
{
.....

SortedList VLans_LIST = new SortedList();
foreach (string CurrRegex in new string[] { "^(?\\d+)\\.", "^(?\\d+\\.\\d+)\\.", "^(?\\d+\\.\\d+\\.\\d+)\\." })
{

string VLanValidated = RegEX_Validate(CurrRegex , "vlan", ipAddress);
if (VLanValidated == null)
{ //do nothing }
else if (!VLans_LIST.Contains(VLanValidated))
{
VLans_LIST.Add(VLanValidated, VLanValidated);
}
}
}

string RegEX_Validate(string RegexString, string RegexValueParam,string StringToVal)
{
Regex objNaturalPattern = new Regex(RegexString);
if (objNaturalPattern.Match(StringToVal).Success )
{
Match VMatch = objNaturalPattern.Match(StringToVal);
return VMatch.Groups[RegexValueParam].Value;
}
else return null;
}