Thursday, June 19, 2008

Print first 10 prime numbers

To print first 10 Prime Number

Void main()
{
Int I, count=1;
For(i=1;i<=100;i++)
{
For(j=1;j<=I;j++)
{
If(j%2==0)
{
Continue;
}
If(j==i)
{
Cout<<”Number is prime”< Count=count+1;
}
If (count==10)
{
Break;
}
}

Lan Cable Colour Coding

1. White of Orange
2. Orange
3. White of Green
4. Blue
5. White of Blue
6. Green
7. White of Brown
8. Brown

Wednesday, April 2, 2008

making flash movie transparent

param value="transparent" name="wmode" param name="wmode" value="transparent" close tag here

Now, find the embed tag and add the following tags along with the other embed tags:
wmode="transparent"

Tuesday, April 1, 2008

changing listview according to change in treeview and listbox

ListView1.Items.Clear()
Dim a, b As String
a = ListBox1.SelectedItem
If File.Exists(TreeView1.SelectedNode.Text & "\" & a) Then
b = TreeView1.SelectedNode.Text & "\" & a
Dim y As FileInfo = New FileInfo(b)
ListView1.Items.Add(y.Length / 1024 & " KB")
ListView1.Items(0).SubItems.Add(y.CreationTime)
ListView1.Items(0).SubItems.Add(y.LastAccessTime)
ListView1.Items(0).SubItems.Add(y.IsReadOnly)
Else
ListView1.Items.Add("This is a directory")
End If

Running Any process in vb.net

Dim p As New Process
Dim pi As New ProcessStartInfo
pi.FileName = TreeView1.SelectedNode.Text & "\" & ListBox1.SelectedItem
pi.UseShellExecute = True
p.StartInfo = pi
p.Start()

Wednesday, March 19, 2008

Birthday Reminder VB.net

Dim a As DateTime
a = Now

vconn = New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=c:\friends.mdb")
vconn.Open()

vadapter = New OleDbDataAdapter("select * from birthdays", vconn)
vdataset = New DataSet
vadapter.Fill(vdataset, "birthdays")
vdatatable = vdataset.Tables(0)

Dim x As Integer

Dim y As Integer = 0
For x = 0 To vdatatable.Rows.Count - 1
If DatePart("m", vdatatable.Rows(x).Item(2)) = Now.Month Then

ListView1.Items.Add(vdatatable.Rows(x).Item(1))
ListView1.Items(y).SubItems.Add(vdatatable.Rows(x).Item(2))
ListView1.Items(y).SubItems.Add(vdatatable.Rows(x).Item(3))
ListView1.GridLines = True
y += 1

End If
Next

Sunday, March 16, 2008

autosuggest & data binding

dim oproducts as new autocompletestringcollection
for each product as productdataset.productrow in me. productdataset.product
if product.name.startswith("O") then
oproducts.add (product.name)
end if
me.combobox.autocompletecustomsource= oproducts