This example demonstrates the quick and simple way to match correct IP address.
MatchesDemo.zip


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace MatchesDemo
{
public partial class IPValidate : Form
{
public IPValidate()
{
InitializeComponent();
}
private void btnValidate_Click(object sender, EventArgs e)
{
// MessageBox.Show(mtxtIPAddress.Text);
// create a regex object
Regex checkIP = new Regex (@"\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b");
// create match
Match matchIP = checkIP.Match(mtxtIPAddress.Text);
if (checkIP.IsMatch(mtxtIPAddress.Text))
{
mtxtIPAddress.ForeColor = Color.Green;
}
else
mtxtIPAddress.ForeColor = Color.Red;
}
}
}
This sample demonstrates use of default constructor, overloaded constructor, method and overloaded method in C#
Create new console C# console application.
Add the following code to Program.cs
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
-
- namespace Classes_002
- {
- class Program
- {
- static void Main(string[] args)
- {
- // create new instance of the Calculate class
- Calculate calc1 = new Calculate();
-
- // call doCalculation method with the default Constructor
- Console.WriteLine(“default constructor: “ + calc1.doCalculation()+“\r”);
-
- // create another instance of the Calculate class
- Calculate calc2 = new Calculate(100);
- // call doCalculation method with the user variable passed to Constructor
- Console.WriteLine(“constructor that accepted user value: “ + calc2.doCalculation() + “\r”);
-
- // create another instance of the Calculate class
- Calculate calc3 = new Calculate();
- // call doCalculation method and pass to variables directly to method0
- Console.WriteLine(“method that accepts two double values: “ + calc2.doCalculation(25.35,10.12) + “\r”);
-
- Console.ReadKey();
- }
- }
- }
Add new class Calculate.cs with the following code
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
-
- namespace Classes_002
- {
- class Calculate
- {
- // declare private variable for the class
- private int constantA;
-
-
- // declare initial value for default Constructor
- public Calculate()
- {
- constantA = 10;
- }
-
-
- // declare Constructor for input of user variable
- public Calculate(int a)
- {
- constantA = a;
- }
-
-
- // method that actually does the calculation
- public int doCalculation()
- {
- return constantA / 2;
- }
-
- public double doCalculation(double val1, double val2)
- {
- return val1*val2;
- }
-
- }
-
-
-
- }
This is a very simple example just to demonstrate how default and overloaded constructors work in C#.
Вот и появилась русская версия версия “Калькулятора желаний”. Для того, чтобы ваше желание исполнилось, необходимо ввести ваше имя, или имя человека, для которого кодируется желание, а затем само желание. Использовать необходимо лишь клавиатуру самой программы! Оба кода необходимо записать на какой-либо части человека, для которого кодируется желание. Этот метод на основе расчетов по СИМОРОНУ уже многих убедил в своей достоверности. Желания действительно сбываются! Попробуйте и напишите, сбылось ли Ваше желание!
Скачать
Personal Numbers Calculator is a small utility that makes calculations basing on your name and last name and suggests your number. Such calculation is based on numerology. Each alphabetical letter is assigned to a number, then all numbers are added until only one digit remains.
This utility is not going to be useful for those who do not believe in numerology and related beliefs. I’ve seen on some web forums people discuss calculations of the “personal number” or “lucky number” and this utility just expedites this calculation.
To use the Personal Numbers Calculator you will need mouse to input your name and last name from the virtual keyboard.
System requirements:
Windows 2000/XP/Vista
Dot Net Framework 2.0
Download
Please, leave your comments, opinions and ideas so I can keep on adding features!
Problem: After installing Internet Explorer 7 or 8 the web management interface of HP LaserJet 2600n printer is no more accessible.
Solution: Install latest firmware. Firmware download.
See the entire thread on HP support:
http://forums13.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=1212128&admit=109447627+1252318317348+28353475
This is a beta version of my Feng Shui Kua number calculator.
Just input your year, month and day of birth and Feng Shui Kua Number Calculator will calculate your Kua number, auspicious and inauspicious directions, your zodiac sign and year.
Years can be selected in the range from 1930 to 2039. These years are based on Chinese lunar calendar, so for example, if a person was born in the beginning-middle of January 1977 his year of birth according to Chinese lunar calendar is 1976 instead of 1977.
This application is very simple but useful for those who want to have a handy desktop tool to determine horoscope signs, Kua number and auspicious directions.
System requirements:
Windows 2000 / XP / Vista 32/64 bit
Dot Net Framework 2.0
Download
Please, leave your comments, opinions and ideas so I can keep on adding features!
I’ve developed this app for personal needs and I would like to share it with anybody who might need it, that’s why your comments are most welcome!
Here’s a PowerShell script that produces the list of desired file types (jpg, bmp, exe, dll, etc.)
Change $path=”C:\” to desired directory.
Change ‘.bmp’ to desired file extension.
If you need to find more that one file type, then add “-or ($file.Extension -eq ‘.some_extension’)” in the if statement, e.g.:
if (($file.Extension -eq ‘.bmp’) -or ($file.Extension -eq ‘.jpg’))
if (($file.Extension -eq ‘.bmp’)-or ($file.Extension -eq ‘.jpg’) -or ($file.Extension -eq ‘.gif’))
$path="c:\"
function showdir {
param (
$path
)
$files=Get-ChildItem $path
foreach ($file in $files) {
if ($file.PSIsContainer) {
showdir -path $file.FullName
}
else {
if (($file.Extension -eq '.bmp')) {
$f=gwmi -Class CIM_DataFile -Filter "Name='$(add_slhs($file.FullName))'"
Write-Host $file.FullName,$f.Version
}
}
}
}
function add_slhs($src) {
$dst=""
for ($i=0;$i -lt $src.length;$i++) {
if ($src[$i] -ne "\") {
$dst=$dst+$src[$i]
}
else {
$dst=$dst+$src[$i]+"\"
}
}
return $dst
}
showdir -path $path
Enjoy!
Today I have received a call from one of our users saying that she can’t open an application published on our Citrix MetaFrame Server. I’ve connected to this user’s PC and noticed the following error:

| For search engines: |
Cannot connect to the Citrix MetaFrame server.
An I/O (Input/Output) error occurred while your request was being processed.
Try to connect again. If you continue to receive this message, contact your Citrix administrator. |

The problem seems to be related to the old network card (NIC). I’ve opened the network connections window and “repaired” the network connection.
The error didn’t occur after that and I could open the published application without any problem.
We have upgraded our servers from Windows 2000 to Windows 2003 and decided to upgrade the virtual SCSI controller from BusLogic to LSI Logic since it guarantees the significant performance boost. So, this is the way I’ve replaced the BusLogic SCSI controller with LSI Logic.
So, here’s how my virtual machine did look like before an upgrade:
Read more…
This script detects and tries to fix the error related to start up of Automatic Updates and BITS services on network computers. Such error is related to security identifier (EventID 7023 and EventID 7024). This problem is usually observed on network computers after applying changes to group policies. In such cases the script will reset a security identifier as per Microsoft KB 555336 (http://support.microsoft.com/kb/555336) and start Automatic Updates and BITS. Can be usefull for networks where Windows Server Update Services 3.0 (WSUS) is used.
Script is taken from: http://forum.vingrad.ru/forum/topic-154708/view-all.html
Read more…