16.12.10

Sender Application VB.NET

Hi Everybody,
I would like to explain one of faq within this essay , how can I can use sender with VB.NET windows application? If any question, please feel free and contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (sender_windows_application)



2-) We are designing this windows form in a similar way to bellowing picture





3-)We are writing this code


Private Sub show_alert_btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles show_alert_btn1.Click
Try
MsgBox(alert_txt.Text, vbInformation, "Sender Application")
Catch ex As Exception
MsgBox(ex.Message, "Sender Application")
End Try
End Sub

Private Sub show_alert_btn2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles show_alert_btn2.Click
show_alert_btn1_Click(sender, e)
End Sub

Private Sub show_alert_btn3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles show_alert_btn3.Click
show_alert_btn1_Click(sender, e)
End Sub

4-) Lets start application and click buttons

15.12.10

Print Document with VB.NET

Hi Everybody,
I would like to explain one of faq within this essay , how can I can use printpreview and printerdialog with VB.NET 2010 windows application? If any question, please feel free and contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (print_document)



2-) We are designing this windows form in a similar way to bellowing picture



3-)We are writing this code

Private Sub Print_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Print_btn.Click
printDocument1.Print()
End Sub

Private Sub Print_preview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Print_preview.Click
printPreviewDialog1.Document = printDocument1
printPreviewDialog1.ShowDialog()
End Sub

Private Sub printDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles printDocument1.PrintPage
Dim fnt_t As Font
fnt_t = TextBox1.Font
e.Graphics.DrawString(TextBox1.Text, fnt_t, New SolidBrush(Color.Black), 10, 10)


End Sub


Private Sub fnt_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles fnt_btn.Click
Dim font_dialog As New FontDialog
If font_dialog.ShowDialog() = DialogResult.OK Then
TextBox1.Font = font_dialog.Font
End If
End Sub

4-) Lets start application and change font




5-) Click Printpreview button




Have a great day

Yener Turkeli
yenerturkeli@v-basic.net

15.11.10

Perfect Style with VB.NET 2010

Hi Everybody,
I would like to explain one of faq within this essay , how can I change standart button style with paint events (VB.NET 2010 windows application)? If any question, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (perfect_styles)




2-) We are designing this windows form in a similar way to the picture below




3-)We are writing this code

Private Sub Button1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Button1.Paint
Dim perfect_style As New System.Drawing.Drawing2D.GraphicsPath

perfect_style.AddEllipse(0, 0, 160, 50)
sender.region = New Region(perfect_style)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("Hello Perfect Style", vbInformation, "Perfect Style")
End Sub


4-) Lets start application and click button





Have a great day

Yener Turkeli
yenerturkeli@v-basic.net

14.11.10

Windows API with VB.NET 2010


Hi Everybody,
I would like to explain one of faq within this essay , how can I can shutdown and restrat Windows with VB.NET 2010 console application? If any question, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (restart_windows)



2-) We are writing this code

Sub Main()

Console.BackgroundColor = ConsoleColor.Blue
Console.Title = "Restart Windows With VB.NET"
Console.ForegroundColor = ConsoleColor.Red

Console.WriteLine("Do you want to restart or shutdown your computer?")
Console.WriteLine("Please press S by keyboard in order to shutdown ")
Console.WriteLine("Please press R by keyboard in order to restart ")

Dim preferrence As String
preferrence = Console.ReadLine()

If preferrence = "S" Then
System.Diagnostics.Process.Start("ShutDown", "/s")
ElseIf preferrence = "R" Then

System.Diagnostics.Process.Start("ShutDown", "/r")

Else

Console.WriteLine("Please press S or R ")

End If

Console.ReadLine()

3-) Lets start application





4-) Press R or S and see the result


1.11.10

RGB Color Combination with VB.NET 2010

Hi Everybody,
I would like to explain one of FAQs within this essay , how can we see RGB color details with VB.NET 2010 windows application? If any question, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (rgb_color)



2-) We are designing this windows form in a similar way to the picture below



3-)We are writing this code

Private Sub apply_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles apply_btn.Click
'set rgb color
Try
'show rgb color combination on picturebox
PictureBox1.BackColor = Color.FromArgb(Val(red_txt.Text), Val(green_txt.Text), Val(blue_txt.Text))
Catch ex As Exception

'give message any exception
MsgBox(ex.Message)
End Try


End Sub


4-) Lets start application and click apply button




5-) Change RGB text values and click button again




Have a great day

Yener Turkeli
yenerturkeli@v-basic.net

10.10.10

Send Keys With VB.NET 2010

Hi Everybody,
I would like to explain one of faq within this essay , how can I send keys with VB.NET 2010 windows application? If any question, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (send_keys)



2-) We are designing this windows form in a similar way to the picture below



3-)We are writing this code

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Shell("notepad.exe", AppWinStyle.NormalFocus)
SendKeys.Send(text_txt.Text)

End Sub


4-) Lets start application



2.10.10

My PC Talk with sapi.spvoice

Hi Everybody,
I would like to explain one of faq within this essay , how can I use SAPi with VB.NET 2010 windows application? If any question, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (my_pc_talk)



2-) We are designing this windows form in a similar way to the picture below




3-)We are writing this code

Dim my_pc_talk

Private Sub start_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles start_btn.Click

my_pc_talk = CreateObject("sapi.spvoice")
my_pc_talk.volume = 40
my_pc_talk.rate = 2
my_pc_talk.speak(text1_txt.Text)
my_pc_talk.pause()
End Sub





Private Sub btn_resume_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_resume.Click
my_pc_talk.resume()
my_pc_talk.speak(text2_txt.Text)
End Sub


4-) Lets start application



Have a great day

15.9.10

Get Computer Information

Hi Everybody,
I would like to discuss one of the most FAQs regarding how we can see computer details with VB.NET 2010 console application ? If you have any questions, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new console Application Project (ftp_upload)



2-) We are writing this code

Sub Main()
Console.WriteLine("VB.NET 2010 Computer Information")
Console.WriteLine("Computer Name: " & My.Computer.Name)
Console.WriteLine("Computer Time: " & My.Computer.Clock.LocalTime)
Console.WriteLine("Network is available: " & My.Computer.Network.IsAvailable)
Console.ReadLine()

End Sub

3-) Lets start application

14.9.10

FTP Wizard - VB.NET 2010

Hi Everybody,
I would like to discuss one of the most FAQs regarding how we can upload files on FTP web sites with VB.NET 2010 Windows application ? If you have any questions, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (ftp_upload)





2-) We are designing this windows form in a similar way to the picture below




3-)We are writing this code

Private Sub select_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles select_btn.Click
Dim open_file As New OpenFileDialog
open_file.Filter = "Files *.*"

Try
If open_file.ShowDialog() = DialogResult.OK Then

file_name_txt.Text = open_file.FileName
Else
MsgBox("Please select a file", vbInformation, "FTP Wizard")

End If
Catch ex As Exception
MsgBox(ex.Message, vbCritical, "FTP Wizard")
End Try

End Sub



Public ReadOnly Property name_f(ByVal path As String) As String

Get

Dim i As Integer = path.LastIndexOf("\")

If i >= 0 And i < (path.Length - 1)

Then Return path.Substring(i + 1)

Else Return ""

End If

End Get

End Property


Private Sub upload_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles upload_btn.Click

Try Dim ftp_request As System.Net.FtpWebRequest = _ CType(System.Net.FtpWebRequest.Create("ftp://ftp.v-basic.net/httpdocs/vb_ftp_wizard/" & name_f(file_name_txt.Text)), System.Net.FtpWebRequest)

ftp_request.Method = System.Net.WebRequestMethods.Ftp.UploadFile

ftp_request.Credentials = New System.Net.NetworkCredential("yenerturkeli", "h545454445") ftp_request.UseBinary = True

ftp_request.KeepAlive = False

ftp_request.Proxy = Nothing

Dim ftp_file() As Byte = System.IO.File.ReadAllBytes(file_name_txt.Text)

Dim f_stream As System.IO.Stream = ftp_request.GetRequestStream f_stream.Write(ftp_file, 0, ftp_file.Length)

f_stream.Close()

f_stream.Dispose()

MsgBox("Excellent File Published", vbInformation, "FTP Wizard")

Catch ex As Exception

MsgBox(ex.Message, vbCritical, "FTP Wizard")

End Try

End Sub

4-) Lets start application






5-) Lets check the FTP folder

Have a great day and enjoy with useful essay.
Yener Turkeli

1.9.10

Picture Get Pixel with VB.NET 2010

Hi Everybody,
I would like to discuss one of the most FAQs regarding how we can see image's RGB values with VB.NET 2010 Windows application ? If you have any questions, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

What is RGB?
RGB(Red,Green,Blue) is a color model which provide in various ways to produce colors.

What is Pixel?
Pixel is a single point of image, in other words, the smallest addressable screen element in a image.

1-) We are creating a new Windows Application Project (picture_get_pixels)



2-) We are designing this windows form in a similar way to bellowing picture
(1 Picturebox, 2 textbox , 2 button)



3-) We are writing this code

Private Sub upld_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles upld_btn.Click
Dim open_file As New OpenFileDialog
open_file.Filter = "Pictures Files| *.bmp;*.jpg;*.gif;*.wmf;*.tif;*.png"

Try
If open_file.ShowDialog() = DialogResult.OK Then

picture_bx.Image = Image.FromFile(open_file.FileName)

Else
MsgBox("Please select a picture", vbInformation, "Pictures Files")

End If
Catch ex As Exception
MsgBox(ex.Message, vbCritical, "Pictures Files")
End Try




End Sub

Private Sub get_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles get_btn.Click
Try
Dim r_color As Color
Dim picture_b As New Bitmap(picture_bx.Image)

r_color = picture_b.GetPixel(x_txt.Text, y_txt.Text)

MsgBox("Red Value: " & r_color.R & " Green Value: " & r_color.G & " Blue Value " & r_color.B, vbInformation, "Pictures Files")

Catch ex As Exception
MsgBox(ex.Message)
End Try

End Sub

4-) Lets start application

18.8.10

VB.NET Directory Create and Check

Hi Everybody,
I would like to discuss one of the most FAQs regarding how we can create a directory and check directory in local drive with VB.NET 2010 console application ? If you have any questions, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.


1-) We are creating a new Console Application Project (create_directory)



2-) We are writing this code


Imports System.IO

Module Module1

Sub Main()
Dim dir_path As String

Try
Console.BackgroundColor = ConsoleColor.Blue
Console.ForegroundColor = ConsoleColor.Red
Console.WriteLine("Please write directory path")
dir_path = Console.ReadLine

If Not Directory.Exists(dir_path) Then
Console.BackgroundColor = ConsoleColor.Green
Console.ForegroundColor = ConsoleColor.White
Console.WriteLine("Directory will create at:" & dir_path)
Directory.CreateDirectory(dir_path)

Else
Console.BackgroundColor = ConsoleColor.Red
Console.ForegroundColor = ConsoleColor.White
Console.WriteLine("Directory exist at:" & dir_path)

End If
Catch ex As Exception

End Try



Console.ReadLine()
End Sub

End Module

3-) Lets start program(F5)






If directory exist.



Have a great day
Yener Turkeli

10.8.10

Get Directory List VB.NET 2010


Hi Everybody,
I would like to discuss one of the most FAQs regarding how we can see directory list on local driver with VB.NET 2010 Windows application ? If you have any questions, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Console Application Project (get_directories)



2-) We are writing this code


Sub Main()

Dim directory_path As String
Console.WriteLine("Please write directory name")
directory_path = Console.ReadLine

Console.WriteLine("All Directory List")

For Each dir_Folder As String In _
My.Computer.FileSystem.GetDirectories(directory_path)

Console.WriteLine(dir_Folder.ToString)



Next

Console.ReadLine()

End Sub

3-) Lets start program(F5)






Have a great day

Yener Turkeli
yenerturkeli@v-basic.net

2.8.10

is Internet Available?

Hi Everybody,
I would like to discuss one of the most FAQs regarding how we can point out internet is available with VB.NET ? If you have any questions, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Console Application Project (internet_checker)



2-) We are writing this code


Function check_internet() As Boolean
Dim vb_url As New System.Uri("http://www.v-basic.net")
Dim vb_WebR As System.Net.WebRequest
vb_WebR = System.Net.WebRequest.Create(vb_url)
Dim vb_response As System.Net.WebResponse
Try

vb_response = vb_WebR.GetResponse
vb_response.Close()
vb_WebR = Nothing
Return True
Catch ex As Exception


vb_WebR = Nothing

Return False
End Try
End Function



Sub Main()
Console.WriteLine("Internet Connection is checking")
If check_internet() = True Then
Console.ForegroundColor = ConsoleColor.White
Console.BackgroundColor = ConsoleColor.Green
Console.WriteLine("Internet Connection is available")

Else
Console.WriteLine("Internet Connection is unavailable")
End If

Console.Read()
End Sub

3-) Lets start program(F5)


Have a great day

25.7.10

Use Colors with Console Application


Hi Everybody,
I would like to discuss one of the most FAQs regarding how we can use colors with VB.NET Console application ? If you have any questions, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Console Application Project (colored_console)



2-) We are writing this code

Sub Main()
Console.BackgroundColor = ConsoleColor.Blue
Console.ForegroundColor = ConsoleColor.Red

Console.WriteLine("Hi This is very useful example for us Background Color Blue")

Console.BackgroundColor = ConsoleColor.White
Console.ForegroundColor = ConsoleColor.Blue

Console.WriteLine("Hi This is very useful example for us Background Color White")

Console.BackgroundColor = ConsoleColor.Black
Console.ForegroundColor = ConsoleColor.White

Console.WriteLine("Hi This is very useful example for us Background Color Black")

Console.WriteLine("Have a great day")

Console.ReadLine()
End Sub


3-) Lets start application


22.7.10

VB.NET 2010 Email Sending

Hi Everybody,
I would like to discuss one of the most FAQs regarding how we can send email with VB.NET 2010 Windows application ? If you have any questions, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

1-) We are creating a new Windows Application Project (VBNET2010_email)



2-) We are changing Form1 Text properties (Email Sending)



3-)We are designing this windows form in a similar way to the picture bellow




4-) We are writing this code

Private Smtp_Server As New SmtpClient()

Private Sub email_send_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles email_send.Click
Try

Dim e_mail As New MailMessage()
Smtp_Server.Credentials = New Net.NetworkCredential("yener.turkeli@v-basic.net", "password")
Smtp_Server.Port = 25
Smtp_Server.Host = "mail.v-basic.net"
e_mail = New MailMessage()
e_mail.From = New MailAddress(from_txt.Text)
e_mail.To.Add(to_txt.Text)
e_mail.Subject = "VB.NET Email Sending"
e_mail.Body = text_txt.Text
Smtp_Server.Send(e_mail)

Catch error_t As Exception
MsgBox(error_t.ToString)
End Try
End Sub

5-) Please click Send Email button in order to send email





6-) Lets Check Email Box



Have a great days


Yener Turkeli
yenerturkeli@v-basic.net


13.7.10

VB.NET SAP Integration

Hi Everybody,
I would like to give some information about SAP R/3, ABAP , RFC and VB.NET SAP Integration. It is very important to establish connection between SAP and other systems. Hence, VB.NET is most important tool for integration(office, oracle, business object, mysql , mssql server etc).

If you have any question, please feel free to contact me y_turkeli@yahoo.com or yenerturkeli@v-basic.net.

What is SAP?

SAP R/3 is the name of the enterprise resource planning(ERP) software which have been developed by SAP AG. It is an enterprise-wide information system designed to coordinate all the resources, information, and activities needed to complete business processes such as order fulfillment or billing.

SAP architecture of R/3 on a three-tier client/server

Presentation Server(SAP GUI-Graphical User Interface)
Application Server
Database Server

What is ABAP?

ABAP (Advanced Business Application Programming) is a Advanced-level programming language developed by the SAP Company. Abap is similar to Cobol.


What is RFC?

SAP R/3 provide connection between SAP systems and non-sap systems. RFC(Remote Function Call) is the standart interface for communication between SAP Systems.

Sample RFC Function at SAP R/3




If you have any question, please feel free to contact me

I look forwad to hearing from you about your questions.


Yener Turkeli
yenerturkeli@v-basic.net