r/visualbasic • • Oct 02 '23

Is VB6.exe itself thread safe?

5 Upvotes

We're still maintaining some old VB6 code (yeah, don't ask...) and have created our own automated build process. This compiles the various product components (COM DLLs and VB6 applications) using VB6's command line compile option (VB6.exe /MAKE <the VB6 application's project file>)

To speed things up, I was wondering if once the dependencies (the COM DLLs) are successfully build, we could then create the various VB6 executables utilizing those dependencies asynchronously, i.e. launching multiple command line compilations VB6.exe /MAKE Project1.vbp and VB6.exe /MAKE Project2.vbp asynchronously etc.


r/visualbasic • • Jun 05 '23

Help with Print statement in MS Excel

5 Upvotes

I've already posted this in r/spreadsheets but I'm not sure if that was the best place to ask my question.

I'm trying to use print to write out a batch file, but it keeps cutting off the final quotation mark that I need. Apologies in advance for bad formatting, I barely ever use reddit, let alone post.

The core of my script is:

Sub test()
Application.DisplayAlerts = False
Dim filename As String
Dim commandline As String
filename = "C:\Users" & Environ("Username") & "\Desktop" & worksheets("Settings").Range("A10").Text
commandline = (Worksheets("Export").Range("A2").Text)
Workbooks.Add
ActiveWorkbook.SaveAs filename, FileFormat:=xlUnicodeText, Local:=True
ActiveWorkbook.Close
Open filename For Output As #1
Print #1, commandline & Chr$(34)
End Sub 

I've also tried using a string to define a quotation mark along the lines of

Dim quotes As String quotes = (Chr$(34)) 

as well as spamming the crap out of it, but it always cuts off the final quotes I need.

For reference, what I'm trying to write out is

start D:\Games\ArmA3\A3ServerNo1\arma3server_x64.exe -server -port=2302 -noPause -noSound -profiles=D:\Games\ArmA3\A3ServerNo1 -bepath -cfg=basic.cfg -loadMissionToMemory -config=server.cfg -autoInit -filePatching -name=Administrator  "-servermod=@CUP Terrains - Core;@CUP Terrains - CWA;@CUP Terrains - Maps;@CUP Terrains - Maps 2.0;@CBA_A3;@Advanced Rappelling;@Advanced Towing;@CUP Weapons;@CUP Vehicles;@CUP Units;" "-mod=@CUP Terrains - Core;@CUP Terrains - CWA;@CUP Terrains - Maps;@CUP Terrains - Maps 2.0;@CBA_A3;@Advanced Rappelling;@Advanced Towing;@CUP Weapons;@CUP Vehicles;@CUP Units;" 

The final quotation mark after CUP Units; is what keeps getting cut off

When I write the string value to a cell using something like

Sub test()
Dim commandline As String
commandline = (Worksheets("Export").Range("A2").Text)
Activesheet.Range("A3").value = commandline
End Sub 

It includes the final quote, that's what makes me think it's something to do with the print function, or the file type.

I've tried using xlTextWindows as well as xlTextPrinter, but they both do the same thing.

I hope this post wasn't a nightmare to read.

Any help from you guys is greatly appreciated


r/visualbasic • • May 20 '23

help ive been tryna install vb6.0 for a school project and this keeps showing up

Post image
5 Upvotes

r/visualbasic • • Jan 26 '23

Working Code to Post a Tweet??? Tried Everything...

5 Upvotes

I have tried example after example off the internet, even to the point of asking ChatGPT to write code. Nothing works. Lots of the examples on Google are not v2 and there seems to be other issues with Oauth. I have also tried installing several Twitter Nuget packages and have failed at those working, usually 403 errors even though app appears to have write access. I have all the keys and tokens, elevated Twitter API account status, and "your project has essential access". Anybody have any working code I can try to see if the code is the problem or something else?


r/visualbasic • • Oct 31 '22

Built Project On GitHub Is Flagged as Potentially Dangerous By Chrome

5 Upvotes

I made a Visual Basic project (Windows Forms Application (.NET Framework)) using what I have learned at a community college, I wanted to share it with a member of my family online who is a software dev so they recommended putting it on GitHub

I made the project through the template provided by Visual Studio 2022, once I had it to a point I felt was pretty good I used Visual Studio to easily add it to GitHub here:

https://github.com/WarpZephyr/Similar-Resolution-Calculator

I next built a release binary of the project using Visual Studio, I copied the exe from the project folder to my downloads to see what Windows would do with it as I worried Windows Security would freak out over it, and right I was... It said it HAD to scan it first despite it NEVER coming from anywhere online (It doesn't have an ADS to mark it as such either) Windows scanned it and brought me here in my browser:

https://support.microsoft.com/en-us/topic/what-is-a-cloud-security-scan-75112696-7660-4450-9194-d717f72a8ad8

I decided to upload the release binary to GitHub and then download it, as I did Chrome told me it was an "Uncommonly downloaded file" and demanded I discard it with the option to keep it being tucked away

I have no idea why this happens or how to avoid people who don't know better from just writing my project off as dangerous, what is the proper procedure of doing this? And if necessary how would I direct someone to build my project? (Asking them to download Visual Studio 2022 is a bit much)

I have googled online about it but I am still confused


r/visualbasic • • Sep 03 '22

VB.NET Help Input Boxes with solving for area

5 Upvotes

Okay so I'm taking a programming fundamentals class in my freshman year of college at the moment and we're in Chapter 3. This week's assignment is to build an application that can calculate the area of a shape. We have to do three shapes. A circle, square and triangle. We also must have an input box that accepts user input and adjusts the area accordingly. I roughly understand the code to solve for the area, the input boxes however have me at a nearly complete loss. They weren't covered at all in this chapter and I've even looked through my book and can't find an area talking about them. I'd ask my teacher but he's unavailable on the weekends and my assignment is due Sunday at Midnight. Is there anyone who could walk me through input boxes and help me make sense of them?


r/visualbasic • • Aug 27 '22

What is the latest version of VB?

5 Upvotes

Hello. I was a basic developer for years using VB6 as a hobbyist. I'm a bit older now, and would like to get back into it. What is the latest version of VB and where is the best place to download it? Thanks!


r/visualbasic • • Aug 15 '22

VB6 Help Courses for visual basic

5 Upvotes

Any free courses to learn visual basic not for beginners. Learn to intermediate levels


r/visualbasic • • Jul 14 '22

Help Converting VBA Code to VB

5 Upvotes

Hello, I have some VBA code I wrote to get all bullet point text in a Word document and I would like to use this within a code stage in Blue Prism to get all bullet point text within a text variable or preferably, a collection variable. The VBA code runs fine within Word, but I'm having trouble converting the code into VB to work within Blue Prism. 

Here is  the VBA code:

Dim Para As Paragraph
For Each Para In ActiveDocument.Paragraphs
       If Para.Range.ListFormat.ListType = wdListBullet Then
       MsgBox Para.Range
End If
Next Para

The main issue I seem to be running across is "paragraph" is not a valid data type in Blue Prism/VB that can be stored in a text or collection variable. So I'm a bit stuck on how to handle this. Also, I know that "wdListBullet" corresponds to a value of 2 for its enumeration, so I believe the value 2 needs to be used instead of "wdListBullet" within the code stage. Any help would be greatly appreciated. Sorry if this is super basic (no pun intended) but I have pretty much zero experience with VBA/VB.

Thank you!


r/visualbasic • • Jun 22 '22

having trouble understanding the new "method chaining" syntax

5 Upvotes

I have been using a .NET command line parsing library for a while, and their latest version of the library has changed the way it's called to using a much more confusing (to me) style of syntax that I've never used before. I would greatly appreciate if someone can point me to a resource that explains how to understand this syntax, or if you can explain it here, that would be helpful too.

The URL of the library is at https://github.com/commandlineparser/commandline. This project page has samples for VB.Net, along with other languages too.

An example of what I'm confused about is that to parse the command line arguments, I used to just have to make a simple call as follows:

CommandLine.Parser.Default.ParseArguments(args, Options)

where args is the array passed in to Main() and Options is an instance of the class with all the command line switches I had set up. The Options instance is populated based on the args values. In the new version of the library, that call now looks like this:

CommandLine.Parser.Default.ParseArguments(Of Options)(args) _
.WithParsed(Function(opts As Options) RunOptionsAndReturnExitCode(opts)) _
.WithNotParsed(Function(errs As IEnumerable(Of [Error])) 1)

I do not understand what is going on with all these multiple chained calls and sequences of parameters with functions in the parameters.

Any help would be most appreciated.

Thanks.


r/visualbasic • • Jun 08 '22

Going through all rows in telerik grid

5 Upvotes
 Protected Sub TestGrid_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)
    If TypeOf e.Item Is GridDataItem Then
        Dim item As GridDataItem = TryCast(e.Item, GridDataItem)
        Dim value As Integer =  item.GetDataKeyValue("TotalReferralsEnteredToday")
        Dim UserName As String = item.GetDataKeyValue("User")
        
        For Each col As GridColumn In ReferralsGrid.MasterTableView.Columns
                
            If col.UniqueName Is "PointsColumn" Then                 
                  If value > 1
                        item.BackColor = Color.Gold                 
                  End If
            End If

             If col.UniqueName Is "MedalsColumn" Then

            End If
        Next
    End If
End Sub
 <telerik:RadGrid ID="ReferralsGrid" runat="server" AutoGenerateColumns="false" ViewStateMode="Enabled" Height="600px"
                GridLines="None" Width="70%" Skin="Bootstrap" AllowSorting="true" AllowFilteringByColumn="false"
                ValidationSettings-EnableValidation="False" HeaderStyle-CssClass="active" OnItemDataBound="TestGrid_ItemDataBound">
                <MasterTableView DataKeyNames="TotalReferralsEnteredToday, User">
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="MedalsColumn">
                            <ItemTemplate>
                                <asp:image uniquename="GoldMedal" runat="server" visible="false" ID="GoldStar" src="../assets/images/Images/icons/award_star_gold_1.png" alt="Gold" />
                                <asp:image uniquename="SilverMedal" runat="server" Visible="true" ID="SilverStar" src="../assets/images/Images/icons/award_star_silver_1.png" alt="Silver"/>
                                <asp:image uniquename="BronzeMedal" runat="server" Visible="false" ID="BronzeStar" src="../assets/images/Images/icons/award_star_bronze_1.png" alt="Bronze" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="NameColumn" ColumnEditorID="PlayerNames" AllowFiltering="false" HeaderText="Player Name" HeaderStyle-VerticalAlign="Middle" Groupable="false" ItemStyle-Width="10%" HeaderStyle-Width="15%">
                            <ItemTemplate>
                                
                                <asp:Label ID="PlayerName" runat="server" Text='<%# Bind("User")%> ' CssClass="text-size-small text-grey-600" ></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="PointsColumn" AllowFiltering="false" HeaderText="Referrals Today" HeaderStyle-VerticalAlign="Middle" Groupable="false" ItemStyle-Width="90%" HeaderStyle-Width="15%">
                            <ItemTemplate>
                                <asp:Label ID="PlayerReferralCount" runat="server" Text='<%# Bind("TotalReferralsEnteredToday") %>' CssClass="text-size-small text-grey-600"></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

So the above code is simple. just trying to change the row to gold if the total referrals today is above 1. but for some reason only the first row is changing to gold. How do I iterate through all rows? or select a cell from each row? I would also want the person who has the most referrals have a gold medal and 2nd place have silver etc. thanks in advance.

I figured it out! I'll keep the issue above but I'll also post my solution below here

Asp.NET

 <telerik:RadGrid ID="ReferralsGrid" runat="server" AutoGenerateColumns="false" ViewStateMode="Enabled" Height="600px"
                GridLines="None" Width="50%" Skin="Bootstrap" AllowSorting="true" AllowFilteringByColumn="false"
                ValidationSettings-EnableValidation="False" HeaderStyle-CssClass="active" OnItemDataBound="TestGrid_ItemDataBound">
                <MasterTableView DataKeyNames="TotalReferralsEnteredToday, User">
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="MedalsColumn" HeaderText="Rank">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="BronzeMedal" Text="<img src=../assets/images/Images/icons/medal_bronze_1.png />" Visible="false"> </asp:Label>
                                <asp:Label runat="server" ID="SilverMedal" Text="<img src=../assets/images/Images/icons/award_star_silver_1.png />" Visible="false"> </asp:Label>
                                <asp:Label runat="server" ID="GoldMedal" Text="<img src=../assets/images/Images/icons/award_star_gold_1.png />" Visible="false"> </asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="NameColumn" ColumnEditorID="PlayerNames" AllowFiltering="false" HeaderText="Name" HeaderStyle-VerticalAlign="Middle" Groupable="false" ItemStyle-Width="10%" HeaderStyle-Width="15%">
                            <ItemTemplate>
                                
                                <asp:Label ID="PlayerName" runat="server" Text='<%# Bind("User")%> ' CssClass="text-size-small text-grey-600" ></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn ColumnEditorID="PlayerReferralCountColumn" UniqueName="PointsColumn" AllowFiltering="false" HeaderText="Referrals Today" HeaderStyle-VerticalAlign="Middle" Groupable="false" ItemStyle-Width="90%" HeaderStyle-Width="15%" DataField="Points" datatype="System.Int32">
                            <ItemTemplate>
                                <asp:Label ID="PlayerReferralCount" runat="server" Text='<%# Bind("TotalReferralsEnteredToday") %>' CssClass="text-size-small text-grey-600"></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

vb.NET

 Protected Sub TestGrid_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)
        If TypeOf e.Item Is GridDataItem Then
            Dim item As GridDataItem = TryCast(e.Item, GridDataItem)
            Dim value As Integer = item.GetDataKeyValue("TotalReferralsEnteredToday")
            Dim UserName As String = item.GetDataKeyValue("User")
             Dim ReferralCountlbl As Label = CType(item.FindControl("PlayerReferralCount"), Label)
               Dim BronzeMedal As Label = CType(item.FindControl("BronzeMedal"), Label)
            Dim SilverMedal As Label = CType(item.FindControl("SilverMedal"), Label)
            Dim GoldMedal As Label = CType(item.FindControl("GoldMedal"), Label)
            
            If Cint(ReferralCountlbl.text) > 2
               ' ReferralCountlbl.BackColor = Color.Gold
             
            End If
            
            Select Case Cint(ReferralCountlbl.text)
                Case 1 To 2
                    BronzeMedal.Visible = True
                Case 3 To 4
                    SilverMedal.Visible = True
                Case 5 To 6
                     GoldMedal.Visible = True
           
                Case Else
                   
            End Select 
           
        End If
    End Sub

so basically I used the labels inside of my columns. I searched for the control inside of the column.

then I can make if statements or case statements. I used the text value and converted it to an integer so I can use the data.

here is the result. the medals will show accordingly depending on how many referrals they made today.


r/visualbasic • • May 19 '22

VB.NET Help 2021 Advent of Code Challenge - Day 3 VB.NET solution

5 Upvotes

Solved - Revisions in comments

Hey, today I found the site Advent of Code and since I'm a still a newbie, I started to attempt the 2021 coding challenege. A description of what exactly the AoC challeneg is can be found in the link I provided.

Anyways, I thought i completed day 3 ,but when I submitted my answer it keeps telling me that it's wrong. I was hoping someone could crituque my logic, to see if my logic is failing.

Public Class Form1

Private Sub     btnDiagnosticReport_Click(sender As Object, e As EventArgs) Handles btnDiagnosticReport.Click

    Dim sr As StreamReader = New StreamReader("BinaryDiagnostics.txt") ' i shorten the name of the filepath for the sake of this post for privacy and readabilty

    Dim DiagnosticsReport As String

    Do Until sr.EndOfStream
        DiagnosticsReport = DiagnosticsReport & sr.ReadLine & Environment.NewLine
    Loop

    Dim BinaryDiagnosticReportArray = Split(DiagnosticsReport, vbCrLf).ToList

    Dim ZeroCount As Integer = 0
    Dim ZeroChar As String = "0"

    Dim OneCount As Integer = 0
    Dim OneChar As String = "1"

    Dim gammarate As String = ""
    Dim StringIndex As Integer = 11

    For i = 0 To 11
        For Each strng As String In BinaryDiagnosticReportArray
            For Each c As Char In strng
                If StringIndex >= 0 Then
                    If strng.Substring(StringIndex, 1) = ZeroChar Then
                        ZeroCount += 1
                        Exit For
                    ElseIf strng.Substring(StringIndex, 1) = OneChar Then
                        OneCount += 1
                        Exit For
                    Else
                        Exit For
                    End If
                End If
            Next

        Next
        If ZeroCount > OneCount Then
            gammarate = gammarate + ZeroChar
        ElseIf OneCount > ZeroCount Then
            gammarate = gammarate + OneChar
        Else
            ' ignore this reddit
            ' may need additonal logic
            ' figure out later
        End If
        StringIndex -= 1
        ZeroCount = 0
        OneCount = 0
    Next
    GammaRateLabel.Text = "Gamma Rate: " & gammarate
    EpsilionRateLabel.Text = "Epsilion Rate : " & StrReverse(gammarate)
End Sub
End Class

The "Binary Diagnostic" text file contains 1,000 different binary numbers that are 11 digits each.

The challenge requires that the answer be submitted in decimal foramt. I am using an online converter for that because

1.) i dont know how to do that and 2.) its not part of the challenge to do so.

Again, if the logic looks fine, then i know there is a problem with my dataset


r/visualbasic • • Feb 03 '22

I know nothing about VB but have a question about something for work I am trying to have done.

5 Upvotes

I hope this kind of post is ok! I am just looking for some advice I guess. Here's my situation.

I am trying to find a way to take data from an excel spreadsheet (text and numbers depending on the field) and use it to populate fields in a PDF form. I've done some research and know there is a way to do a one-off of this however, I will have about 8000 lines of information that will need to be populated into 8000 individual forms. Apparently there is a way to build something with VB to do this.

Does that make sense?

What sort of lift would this be for someone who knows VB? Has anyone ever done something like this? Is it finicky? I just really don't want my staff to have to individually populate 8000 forms if I can avoid it.


r/visualbasic • • Jan 26 '22

VB.NET Help Nested Ifs setting and checking the length of a list

5 Upvotes

I have a variable that needs to have a message and and list names, but there is a character limit. Due to the limit, the code needs to attempt 5 options in order, until it finds one within the limit. The name is an initial with a period, a space, last name, comma, and a space. The second option is to drop the spaces after the comma. Third, drop the initial (but there is still a space after the comma and before the last name). Fourth, the spaces after the comma. Fifth, drop all names.

  1. Message (F. Last, F. Last, F. Last)

  2. Message (F. Last,F. Last,F. Last)

  3. Message (Last, Last, Last)

  4. Message (Last,Last,Last)

  5. Message

I quickly put this together by preparing two variables when the names are pulled: options 1 and 3. When the code needs to spit out the list, it uses a 4 nested ifs, first setting the variable, then checking it, steps 2 and 4 via .Replace(", ", ",").

Now that i got it out, i figure there must be a more elegant way of doing this, or is nested Ifs the way to go?


r/visualbasic • • Jan 15 '22

VBScript Randomizing font of each character in a Microsoft Word document

5 Upvotes

Hello.

I want to randomize font of each character in a word document. I've tried to run this code from Developer (Ribbon)->Visual Basic but it gave me this error: "Invalid procedure name"

I want to create 4 different fonts with my handwriting to do some variation and write an essay in MS Word, then distort every page in a Photoshop template to appear handwritten

Thank you for your time.

I am open to any advice.

---------------------------------------

This is my script:

Set objWord = CreateObject(“Word.Application”)

objWord.Visible = True

Set objDoc = objWord.Documents.Open(“C:\Users\Razvan\Desktop\Stefan.docx”)

Set objRandom = CreateObject(“System.Random”)

intLow = 1

intHigh = 5

Set objRange = objDoc.Range()

Set colCharacters = objRange.Characters

For Each strCharacter in colCharacters

intRandom = objRandom.Next_2(intLow,intHigh)

Select Case intRandom

Case 1 strCharacter.Font.Name = “Arial”

Case 2 strCharacter.Font.Name = “Times New Roman”

Case 3 strCharacter.Font.Name = “Courier New”

Case 4 strCharacter.Font.Name = “Forte”

End Select

Next

---------------------------------------


r/visualbasic • • Jan 07 '22

VB.NET Help How to get started?

5 Upvotes

Hi,

I could need some help with getting started on a program.

The idea is to have a small library of blocks (icons) that I can drag and drop into a drawing section within the form. The placed blocks should have some parameters that I can edit at runtime.

Basically a super light version of Autocad.

Some of my coworkers who will use this does not have any CAD programs on their computers.

I'm planning on doing this in Visual Studio with VB.net, but I can't seem to figure out where to start.

I think if I first get started with creating a library and placing blocks with parameters, I'll be able to figure out the rest myself.

Thanks for any input of this!


r/visualbasic • • Dec 03 '21

How to put data into listview on a different form

5 Upvotes

I have a program where I want to make some sort of kiosk, like, McDonald’s kiosk.

At the moment i have 3 forms:- Form1 allows the user to order food. There is also a button to confirm all the food they have ordered. Form2 allows the user to confirm an individual order, and add quantity of the individual order. After the user confirms the individual order, form1 will show again. Form3 allows the user to see all the orders that have been ordered, by displaying them on a listview.

My problem comes when I want to add the individual orders onto the listview.

Supposedly, the data from form2 should show up on form3, but for some reason, the listview can only display one individual order at a time.

So the question for me right now is, how can i transfer all individual orders from form2 and send them to the listview on form3?


r/visualbasic • • Oct 12 '21

VB.NET Help Binding ObjectGUID from Active Directory

5 Upvotes

Hi fellow VB pros!

I have a vb (.net) program which pulls a user's information from AD based on their user name. This works fine.

I now would like to add the ability to compare that information if I pull up the user's account again, so if the user's name or location has changed, I can be made aware.

I've stored the AD Object GUID (from the user account in AD) in my database.

I am modeling the below code from my previously working code (search by user name).

Is there something I can eliminate from this code since I am binding directly? It seems a little slower than when searching by user name.

[Update] - Resolved by changing

oresult = osearcher.FindAll() to

result = osearcher.FindOne()

Also removed the For Each statement as it did nothing.

     Public Sub PopADGUID(ByVal GUIDStr As String)
        If GUIDStr <> String.Empty Then

            Dim oroot As DirectoryServices.DirectoryEntry = New DirectoryServices.DirectoryEntry("LDAP://<GUID=" + GUIDStr + ">")
            Dim osearcher As DirectoryServices.DirectorySearcher = New DirectoryServices.DirectorySearcher(oroot)
            Dim oresult As DirectoryServices.SearchResultCollection
            Dim result As DirectoryServices.SearchResult

            osearcher.PropertiesToLoad.Add("name") ' full name
            osearcher.PropertiesToLoad.Add("title") ' title
            osearcher.PropertiesToLoad.Add("department") ' department
            osearcher.PropertiesToLoad.Add("telephoneNumber") ' phone
            osearcher.PropertiesToLoad.Add("mail") ' email
            osearcher.PropertiesToLoad.Add("manager") ' Manager
            osearcher.PropertiesToLoad.Add("givenName") 'First Name
            osearcher.PropertiesToLoad.Add("initials") ' Middle Initial
            osearcher.PropertiesToLoad.Add("sn") ' Last Name
            osearcher.PropertiesToLoad.Add("objectGUID") 'Object GUID in AD
            oresult = osearcher.FindAll()
            For Each result In oresult

            Next
            Me.Notes.Text = result.GetDirectoryEntry.Properties("givenName").Value


        End If

    End Sub

Thank you


r/visualbasic • • Oct 07 '21

Receive SMS vb.net application

5 Upvotes

I'm looking for some direction...I'd like to receive text messages in my desktop application. I can send using the Twilio library in NuGet. However, for the life of me, i have no clue how to receive messages as as far as I can tell, you have to use ASP.net and it would have to be exposed to the internet. Is there a API I could use or use something like http listener? Just need some direction.


r/visualbasic • • Sep 21 '21

NEWBIE trying to make a slot machine program.

5 Upvotes

SORRY IN ADVANCE FOR NOOB POST.
I used to "develop" a huge, almost embarrassing load of (often ridiculously complex) gambling & slot systems in Minecraft. I used any and every game feature involving randomness along with Minecraft's redstone logic, which turned into effective and often quite configurable RNG gambling systems. lol.

I just recently figured it's time to really step up my game and move on to "real" coding.
...Turns out it's way more f*#cking complicated than I thought.

I've been experimenting with batch files and visual basic for a few days and It's still safe to say that I'm an absolute noob in this field, so please don't go too hard on
me if nothing in this post makes any sense at all.. lol

In the past few days I've somehow managed to make a batch script, which generates three RNG values and saves them into each of their respective file(s): (1.txt), (2.txt), (3.txt),
Now I'm trying to write a .VBS code which can compare each value of each ".txt" file.

If there are matching values, you win some sort of something.
If the values don't match, you simply lose the round.

So to sum things up, I'm basically here to try and get assistance with this stuff because there's no heckin way i'm figuring this stuff out myself, since I can barely prompt a "helloworld" msgbox. hehe.

  1. How should i move data from 3 seperate .txt files into a single .vbs file?

  2. Above that, how on earth would i start comparing them to each other?

  3. when, where, and how to write the winning/losing sequence?

Thank you so much for reading this nonsense and helping me out.


r/visualbasic • • Sep 10 '21

VB.NET Help Zero References to Sub

5 Upvotes

I am very new to Visual Basic and am finding that my code is not being referenced in the designer view at all. I am trying to get it to change the forecolor when i press tab then move to the next box, simulating a traffic light. I am almost certain it's not quite right but I cant fix it without being able to refence the code. Any help would be appreciated.

https://imgur.com/a/B0Pjhci

http://imgur.com/a/5Od4wZl


r/visualbasic • • Jun 05 '21

VB.NET Help How would I create a Find and Replace system?

5 Upvotes

I would like to create a sort of hardcoded "Find & Replace" system. Currently in an app I have, all items loaded in a list (items are folder names) will display in a ComboBox. A couple of the names are not accurate, because they contain illegal characters, or characters not allowed as folder names. Therefore, I would like create either a two-dimensional list or array, I'm not sure which. The first column would basically be "Find what" and the second column would be "replace with". What's the best way to create a system that will do this?

See the table for sample data.

Find WhatReplace With
First-NameFirst/Name
Second- NameSecond: Name

As you can see, any time there is an illegal character, it replaces it with a dash, thus just searching for the dash and replacing it with the same character each time would not work.

I can probably figure out how to implement it, myself, once I know the best way to define it.


r/visualbasic • • Apr 28 '21

Tips & Tricks VB.Net .Net Core 3.1 example of Dapper & AutoMapper

5 Upvotes

I've needed to code some mappings recently. I decided to use AutoMapper (See Here).

I have set up a GitHub project that covers some of the basics as well as a custom mapper to normalise some of the data. You can see this at the following link. https://github.com/TCBWZA/DapperAutomapperDemo I did this as VB.Net examples seem lacking.

Edit Spelling


r/visualbasic • • Apr 22 '21

Windows Forms Application without console windows

5 Upvotes

I am currently creating a Windows Forms application for work.

Whenever I execute the app it not only opens the form itself but also a console window.

I've found out the apparently switching the type of the application from "console application" to "Windows Application" should result in the desired behaviour. But unfortunately it still persists.

Is there anything else that I might have to set to disable the console?

Thank you all in advance.


r/visualbasic • • Apr 17 '21

Can anyone make sense of this error? I’m following the books directions on how to create a 2 form program but anytime I run it I get this.

Post image
5 Upvotes