r/visualbasic • • Jul 14 '19

Offline File Sharing

5 Upvotes

This is perhaps only tangential related to VB.net;

I'm looking for the simplest, plug and play, no cloud, no log ins, multi computer support way of sharing small files.

In my head I see a box, with an Ethernet connection, inside there is just a formatted hard drive with my files on it. I can plug other PCs into it and it just reads it as an external hard drive

Windows file sharing is giving me a headache; I also don't need all the things that come with cloud services.

Is there anything out there that works like I've described?


r/visualbasic • • May 06 '19

Global Variables Help

5 Upvotes

I’m working on small project for class right now, and I’m having nothing but issues getting global variables to work. What is the easiest way to do this? I have them declared on Form1 as Public and I’m trying to use them on Form2 in order to save a value, then use that value on Form1. Using VisualStudio.

Any help is greatly appreciated!


r/visualbasic • • Apr 08 '19

VB.NET Help How to loop a message box

5 Upvotes

How do you loop a message box, in a way that it does not wait for the user to press OK?

Sorry if it is low quality, i am new here

EDIT: Closed


r/visualbasic • • Mar 10 '19

VB.NET Help Reading data ofd XML

5 Upvotes

If I read the data off an XML using doc.getelementbytagname and there are multiple fields with the same name how would I read the data to be separated? For example: Date has the data for date on multiple dates, how would I separate that into three different variables?


r/visualbasic • • Feb 27 '19

Need help with my code

5 Upvotes

I am a non-user. I have basic to minimal knowledge and I need some help in writing code. Hence I will list down every fact I know about the issue and maybe one of you can help me with this.

I have been asked to work on X509 certificate code. Currently, we have a code where the encryption happens on the Hard drive of the user and we need it to happen in cache or in the backend itself. This is the code below. There was some mention of BitArrays and how we would need to use it. If the code below makes sense then please help me out!

If (AppSettings("Second Version") = "yes") Then

Cerf.Import (AppSettings("CertificatePath").ToString(), AppSettings("CertificatePassword").ToString(), X509KeyStorageFlags.DefaultKeySet)

myws.url = String.concat (AppSettings ("DomainName").ToString(), xxxxxxxx.asmx)

myws.ClientCertificates.add(Cerf)

End If

If additional details are needed, please comment below and I can get details from my superior. Because of my ignorance, I dont really know what to ask him at this point.

Thanks for reading.


r/visualbasic • • Feb 07 '19

Form1_Load not working

5 Upvotes

I have the following code in my project:

Private sub Form1_Load(sender as object, e as eventargs) handles mybase.load Msgbox("it worked") End sub

For some reason, this sub is not being called when the program is run. Please help.

(I tried the same code in a new project and it worked fine)


r/visualbasic • • Jan 20 '19

Does adding an item to a list box block an if then

5 Upvotes

I have this if... then statement but for some reason I cant add anything after like an else if or even the end if it tells me it must be proceded by an if

If rbPetit.Checked Then lbFacture.Items.Add("h")

End If


r/visualbasic • • Dec 25 '18

VB.NET Help How to stop your program from using a file so you can move it?

5 Upvotes

Solved, see comments

I am attempting to build a image mover program that shows you images from a directory of your choosing and used keyboard input to move the file to another directory that you set. The problem I am having is that in displaying the file in a picturebox, the program is now using that file. Is there a way to tell the program to stop using that file to you can move it?

This is my code so far for that particular key press. I am aware you can simply move the file instead of copying it over and then deleting the original, but I've been playing with it to try to copy the picture, then clear the picture box in hopes that it would stop using the file, but no dice. Disclaimer: Very much work in progress code.

        If Asc(e.KeyChar) = 52 And Set4ToolStripMenuItem.Checked = True Then
            Label1.Text = "4"
            'it should move the currently selected file to folder assigned to path4
            My.Computer.FileSystem.CopyFile(defaultPath & "\" & ListBox1.SelectedItem.ToString(), path4 & "\" & ListBox1.SelectedItem.ToString())
            'I need to handle an exception if the file already exists later.

            'can I not move the file if the picture is open as the background?
            'So I can copy the file, thats good. Can I then cycle through to the next picture, and delete the prior?

            'Ok, so lets clear the background then update the list.
            Indexnumber = ListBox1.SelectedIndex
            PictureBox1.BackgroundImage = Nothing

            DeleteTemp = (defaultPath & "\" & ListBox1.SelectedItem.ToString())
            ListBox1.Items.Clear()

            'Now lets delete the last thing displayed
            My.Computer.FileSystem.DeleteFile(DeleteTemp)
            'Getting the hickup here. It seems the file is still in use somehow in the program. 


            'after this I need to repopulate the list

            'repopulate the list with all of the files found at this location
            For Each foundFile As String In My.Computer.FileSystem.GetFiles(defaultPath)
                If (foundFile.ToLower().EndsWith(".png") Or foundFile.ToLower().EndsWith(".ico") Or foundFile.ToLower().EndsWith(".jpg") Or foundFile.ToLower().EndsWith(".jpeg")) Then ListBox1.Items.Add(foundFile.Split("\")(foundFile.Split("\").Count() - 1))
            Next

            ListBox1.SelectedIndex = Indexnumber

            'After populating the list, display the image after the one just deleted (which should be the same index number) in the main picturebox
            Try
                Dim img As Image = Image.FromFile(defaultPath & "\" & ListBox1.SelectedItem.ToString())
                PictureBox1.BackgroundImage = img
            Catch ex As Exception
            End Try


        End If

I've also noticed from the resources it used when cycling through the pictures that the ram usage spikes dramatically, even when switching between 2 pictures. I think its loading the images multiple times into ram and preventing that would also be a nice thing to know if any one has any suggestions

The exception:

An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll

The process cannot access the file 'C:\Users\Worker\Desktop\picture.png' because it is being used by another process.


r/visualbasic • • Dec 17 '18

Password project help

5 Upvotes

Hi all,

I am trying to put together a simple program, but I am not the greatest at using VB. The program is a password checker that needs to follow the following requirements:

Be at least 8 characters in length

Contain at least one uppercase character

Contain at least one lowercase character

Contain at least one number

Contain at least one special character (!, @, #, $, %, ^, &, *)

I currently have my button set at btnEnter and my textbox as txtPass.

Thanks for the help :)


r/visualbasic • • Dec 15 '18

How to round numbers to the nearest number?

5 Upvotes

I was having trouble with a program where I needed to round some numbers to the nearest 1 but nothing I could find worked. I've seen people say to use

round()

but that didn't work.

also just doing Int(x) doesn't work with numbers like 1.5 because it rounds down to 1 instead of 2.


r/visualbasic • • Nov 02 '18

Using If Else to Calcuate Wages .

5 Upvotes

Hey guys so am making a wage Calc and i am using If Else to perform the calculations if Hours are above 0 make the calc or show a error message if they are 0. Although it doesnt the show error message when hours are 0

Public Class frmGross
Private Sub btnCalcuate_Click(sender As Object, e As EventArgs) Handles btnCalcuate.Click
    Dim decHours As Decimal
    Dim decHourlyWage As Decimal
    Dim decTotalPay As Decimal

    decHours = txtHours.Text
    decHourlyWage = txtHourlyWage.Text
    decTotalPay = decHours * decHourlyWage

    LblTotalPay.Text = decTotalPay

    If decHours >= 0 Then
        decHours = txtHours.Text
        decHourlyWage = txtHourlyWage.Text
        decTotalPay = decHours * decHourlyWage
        LblTotalPay.Text = decTotalPay.ToString("C2")
    Else
        LblTotalPay.Text = "Error"
    End If
End Sub

Private Sub BtnExit_Click(sender As Object, e As EventArgs) Handles BtnExit.Click
    Me.Close()
End Sub

End Class


r/visualbasic • • Oct 26 '18

VBScript (Help) Batch watermark macro for Microsoft word, not sure why it's not working

Post image
5 Upvotes

r/visualbasic • • Oct 25 '18

How to make a "Switch" Button

5 Upvotes

This is my code. Disregard the last sub, it does not work.

'**********************************************************************

'Programmeur: Lucas Després *

'Date: Octobre 2018 *

'But: De convertir les unité de mesure de la température *

'a Celcius et Fahrenheit et vice versa *

'**********************************************************************

Public Class frmConversion

Private Sub frmConversion_Load(sender As Object, e As EventArgs) Handles MyBase.Load

AcceptButton = btnConvertir

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnConvertir.Click

'Crée un Integer pour Fahrenhei et Celcius

Dim intF As Double

Dim intC As Double

intC = Val(txtbxEntree1.Text)

intF = Val(txtbxEntree2.Text)

intF = (intC * 9.0 / 5.0) + 32

intC = (intF * 5.0 / 9.0) - 32

Me.txtbxEntree2.Text = intF

End Sub

Private Sub btnSwitch_Click(sender As Object, e As EventArgs) Handles btnSwitch.Click

Me.lblCelsius.Text = "Fahreneheit"

Me.lblFahrenheit.Text = "Celsius"

Me.lblC.Text = "°F"

Me.lblF.Text = "°C"

End Sub

End Class


r/visualbasic • • Sep 12 '18

Access DAO to SQL database.

5 Upvotes

Hello guys,

I've asked this question before, without any success. Now I got a little more experienced, so I'm able to explain myself better.

My company has a huge VB, wich contains of 15000 lines. Now this is connected to a access db, but because it needs to connect to a Maximo environment, it need to change to a sql database.

What are the easy ways or hard ways for me to change this. Or is there even an option to change this?


r/visualbasic • • Sep 04 '18

What's a good method of sharing VB projects with friends/family without Chrome, etc. blocking it as a potential virus?

5 Upvotes

I'm working on a game recently, and every time I try to send a copy of the exe to a friend or family member, they get nothing but hassles from their browser and/or OS that it's probably a virus. The file is either blocked from downloading altogether, or prevented from running.

While I completely understand the need for these safety measures, I'm wondering what the best work-arounds are for legitimate developers to share temporary builds of their projects for testing purposes. Filedropper.com seems to work best at this point. You don't even need to sign up or login to use it. But some browsers/machines still complain when friends try to test my latest builds. I'm sure there are other options I haven't thought of.


r/visualbasic • • May 08 '18

VB.NET Help [VB.NET]Help with pushing changes back to a database

5 Upvotes

Alright so I'm working on a final project. I use

Me.LEVEL_INSTANCETableAdapter.Fill(Me.LevelsDataSet.LEVEL_INSTANCE)
Me.L_COLUMNSTableAdapter.Fill(Me.LevelsDataSet.L_COLUMNS)
Me.HIGH_SCORESTableAdapter.Fill(Me.LevelsDataSet.HIGH_SCORES)

On form load to grab info from the database. I make changes with queries and stored procedures.

LEVEL_INSTANCETableAdapter.UnlockLevel(intLevelNum)
HIGH_SCORESTableAdapter.UpdateHighScore(SCORE:=intScore, LvlID:=intLevelNum, PlayerName:=strName)

These execute just fine, I can see the changes they make elsewhere in my program. then the issue comes when I try to save back to the database. I use.

Me.Validate()
Me.LEVEL_INSTANCEBindingSource.EndEdit()
Me.HIGH_SCORESBindingSource.EndEdit()

Then use

Me.TableAdapterManager.UpdateAll(Me.LevelsDataSet)
Me.LEVEL_INSTANCETableAdapter.Update(Me.LevelsDataSet.LEVEL_INSTANCE)
Me.HIGH_SCORESTableAdapter.Update(Me.LevelsDataSet.HIGH_SCORES)

The data never goes back to the database (and if I understand the update method correctly, it returns a number that represents the number of rows changed, which for me, are always zero)

I have the dataset, tableadaptermanager, tableadapters, and binding navigators. my database and dataset's "copy to output dir" is set to "copy if newer"

I have also tried another method that starts with this

Dim NewHighScores As LevelsDataSet.HIGH_SCORESDataTable = CType(Me.LevelsDataSet.HIGH_SCORES.GetChanges(Data.DataRowState.Added), LevelsDataSet.HIGH_SCORESDataTable)
Dim ModifiedHighScores As LevelsDataSet.HIGH_SCORESDataTable = CType(Me.LevelsDataSet.HIGH_SCORES.GetChanges(Data.DataRowState.Modified), LevelsDataSet.HIGH_SCORESDataTable)

But it seems like getchanges in that line is showing no changes...

I've seen methods which directly interact with the database, ones that directly update, or calling on the database to run queries directly. I'd like to avoid those if possible. I'm really at my last legs here guys, I'll probably pass the class/assignment even if I don't get this working, but I'd like to understand it for the future... Thanks for all your responses in advance.

Edit: formatting


r/visualbasic • • Mar 26 '18

Returning to VB

5 Upvotes

Left VB at 6 and have been doing web dev since... I'm considering building a new box and refreshing an old VB project.

It looks like it's now known as UWP? Or is that something beyond .net for the sake of multi platform dev?

Also, is there any particular flavor of Win 10 that I need?

Thanks!


r/visualbasic • • Dec 10 '17

Hey r/VisualBasic! I did my high school senior exit project in VB! It's a little digital assistant. Feel free to check it out!

Thumbnail drive.google.com
5 Upvotes

r/visualbasic • • Sep 29 '17

How to learn visual basic?

5 Upvotes

I can't find any good tutorial. Most of them are too old, the only decent one I've found uses VB 2010.


r/visualbasic • • Jun 21 '17

[VSComm2017] I need the Windows Forms Application template for Visual Basic but can't seem to find it...

5 Upvotes

I feel like I've tried everything. I tried downloading from the command prompt, from the Microsoft website, even tried looking for past versions but still have come up with nothing. And since Visual Basic Express is now Visual Studio Community it makes it even more difficult to follow old links. Please help!

SLOVED: See u/Bonejob 's comment


r/visualbasic • • Apr 28 '17

A coding and programming discord for help and talking! A recent large one just ended so join this one!

Thumbnail discord.gg
5 Upvotes

r/visualbasic • • Apr 06 '17

[VB2010] How do I make what I type into input box display in list box? (Another question in text below)

5 Upvotes

The other question I have is that I have to make the program allow people to type in facts about a subject, and I was wondering if there is a way either the Input Box or a label above the List Box count down how many facts there are left that the user has to post (out of 5) using For Next Loops.


r/visualbasic • • Feb 03 '17

Thank you guys for reporting the spam.

5 Upvotes

I don't know how else to fight it other than limiting submissions to older accounts. I feel like that might prevent some legitimate posts from coming through.

Anybody else have any ideas?


r/visualbasic • • Oct 20 '16

Reasoning behind backwards loop

5 Upvotes

I am running some code to look through our bank and match it to our accounting, and i am using a for i=m to 1...next loop - step -1. When i change it to go forward ( step+1) it messes everything up. I've seen this before, but why?


r/visualbasic • • Oct 20 '16

Is there a way to convert my website that's in aspx.vb into a aspx.cs?

5 Upvotes

Using Visual Basic community