Executable directory where application is running from?

This is the first post on google so I thought I’d post different ways that are available and how they compare. Unfortunately I can’t figure out how to create a table here, so it’s an image. The code for each is below the image using fully qualified names. My.Application.Info.DirectoryPath Environment.CurrentDirectory System.Windows.Forms.Application.StartupPath AppDomain.CurrentDomain.BaseDirectory System.Reflection.Assembly.GetExecutingAssembly.Location System.Reflection.Assembly.GetExecutingAssembly.CodeBase New … Read more

VS 2008 breakpoint will not currently be hit. No symbols have been loaded for this document

This may be an old question, but I wanted to answer it after I found a solution for this very problem because it was one of the most complete questions asked in regards to this topic. Intro My project is an ASP.NET application, but the base problem will happen on WinForms as well. The problem … Read more

How to add a Browse To File dialog to a VB.NET application

You should use the OpenFileDialog class like this Dim fd As OpenFileDialog = New OpenFileDialog() Dim strFileName As String fd.Title = “Open File Dialog” fd.InitialDirectory = “C:\” fd.Filter = “All files (*.*)|*.*|All files (*.*)|*.*” fd.FilterIndex = 2 fd.RestoreDirectory = True If fd.ShowDialog() = DialogResult.OK Then strFileName = fd.FileName End If Then you can use the … Read more

Create a new thread in VB.NET

There’s two ways to do this; With the AddressOf operator to an existing method Sub MyBackgroundThread() Console.WriteLine(“Hullo”) End Sub And then create and start the thread with; Dim thread As New Thread(AddressOf MyBackgroundThread) thread.Start() Or as a lambda function. Dim thread as New Thread( Sub() Console.WriteLine(“Hullo”) End Sub ) thread.Start()

List(of String) or Array or ArrayList

List(Of String) will handle that, mostly – though you need to either use AddRange to add a collection of items, or Add to add one at a time: lstOfString.Add(String1) lstOfString.Add(String2) lstOfString.Add(String3) lstOfString.Add(String4) If you’re adding known values, as you show, a good option is to use something like: Dim inputs() As String = { “some … Read more

techhipbettruvabetnorabahisbahis forumueduedusedusedusedusedusedueduedusedu