FREE VB.NET SOURCE CODE

Showing posts with label snipet. Show all posts
Showing posts with label snipet. Show all posts

29 March, 2012

[SNP] Disable / Turn Off Windows Firewall [VB.NET]

First add this SUB to your project:

    Private Sub StopFirewall()
        Dim Program As Process = New Process
        Dim top As String = "netsh.exe"
        Program.StartInfo.Arguments = ("firewall set opmode disable")
        Program.StartInfo.FileName = top
        Program.StartInfo.UseShellExecute = False
        Program.StartInfo.RedirectStandardOutput = True
        Program.StartInfo.CreateNoWindow = True
        Program.Start()
        Program.WaitForExit()
    End Sub

Then use it like that:

    StopFirewall()

[SNP] Take Screenshot / Save Screenshot [VB.NET]

  Public Sub TakeScreenshot()  
     Try  
       Dim filename As String = System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\SS.gif", ScreenSize As Size = New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height), screenGrab As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height), g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(screenGrab)  
       g.CopyFromScreen(New Point(0, 0), New Point(0, 0), ScreenSize)  
       If My.Computer.FileSystem.FileExists(System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\SS.gif") Then  
         My.Computer.FileSystem.DeleteFile(System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\SS.gif")  
       End If  
       screenGrab.Save(filename, System.Drawing.Imaging.ImageFormat.Gif)  
     Catch  
     End Try  
   End Sub  


This is the sub, that will get your screenshot, afterwards use this

TakeScreenshot()  
 My.Computer.FileSystem.MoveFile(System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\SS.gif", System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\SS.gif")  

to save your screenshot on your desktop with the name SS.gif

27 March, 2012

[SNP] Show / Hide Folder Options in Windows Explorer [VB.NET]

 Shell("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoFolderOptions /t REG_DWORD /d 1 /f", vbNormalFocus) 

A simple command, that uses registry, to enable or disable Folder Options in Windows Explorer.

Change the 1 to 0 to enable it again.

02 March, 2012

[SNP] Show / Hide Taskbar - Windows XP / 7 [VB.NET]

 Dim intReturn As Integer = FindWindow("Shell_traywnd", "")  
     SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)  
This will disable the taskbar.
And to enable it:
change SWP_HIDEWINDOW to SWP_SHOWWINDOW

MsgBox("Hello World!") - The Big Start

Hello there!

This is a blog about the great programming language Visual Basic.
Here you will find a variety of sources, tutorials, snippets and such.
I hope that it will be helpful to you!

P.S. Theese are written by me, or collected by me from the internet.All credits will be give, if found.
P.S.S. If you have questions, feel free to email me or comment.




And some words now:
vb.net visual basic programming visualstudio studio microsoft sources source codes code snippet snippets tutorial guide tutorials guides training free download snp src srcs snpt framework vb net .net VB.NET VisualBasic blog gratis gratuit gratis libre skid skidding programing vstudio SRC SNP project Projects