Posts

Showing posts from January, 2018

Source Code of How to run 3rd party exe in vb .net

Image
How to run 3rd party exe in vb .net **************************************   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click         Dim FileName As String = IO.Path.Combine(Application.StartupPath, " wrar390.exe ")         Dim BytesToWrite() As Byte = My.Resources.wrar390         Dim FileStream As New System.IO.FileStream(FileName, IO.FileMode.OpenOrCreate)         Dim BinaryWriter As New System.IO.BinaryWriter(FileStream)         BinaryWriter.Write(BytesToWrite)         BinaryWriter.Close()         FileStream.Close()         Process.Start(FileName)     End Sub

Source Code of bmp to icon file

Image
 Source Code of bmp to icon file    ********************************************************* Imports System.Security.Permissions Public Class Form1     <SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags:=SecurityPermissionFlag.UnmanagedCode)> Public Function GetHicon() As IntPtr     End Function     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click         Dim ofd As New OpenFileDialog         Dim sfd As New SaveFileDialog         Dim bitmap As Bitmap         Dim HIcon As IntPtr         Dim newIcon As Icon         Dim oFileStream As IO.FileStream         ofd.Filter = "Bitmap File|*.bmp"         If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then             TextBox1.Text = ofd.FileName           bitmap = New Bitmap(ofd.FileName)             HIcon = bitmap.GetHicon()             newIcon = System.Drawing.Icon.FromHandle(HIcon)             sfd.DefaultExt = ".ico"