Visual Basic.NET

93K

Solutions

24K

Contributors

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to  Visual Basic pre-2002, it is not the same technology,

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi

In VB.net is it possible to create a folder in windows explorer that is password protected?

Thanks
0
JavaScript Best Practices
LVL 13
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Hi

I have an Excel VB.net Add-in project that interacts with an Azure SQL database using a connection string.
I want to control which tables a user can see and edit.
What is the best way to do this. Should it be set up inside the Azure  SQL database per user name
and then a different connection string given to various people?

Thanks
0
I have a chart control in asp.net that I am trying to display annotation in the chart area - topcenter of 'ChartArea1'.  It does not display on the chart.

Why?

Below is my asp.net code

<Annotations>
                                        
                                            <asp:TextAnnotation Alignment="TopCenter" Font="Arial, 10pt" ForeColor="#00FFCC"
                                                Name="Chart1Annotation" Text="Nominal" TextStyle="Default" ClipToChartArea="ChartArea1">
                                            </asp:TextAnnotation>
                                        </Annotations>

Open in new window

0
The code below works fine in a sense it is doing what I need it to do, however I did notice some issues.
1. It will highlight a value that is not inside the bounds of the if statement.
2. When I clear the listbox data on run two the dram items is very slow to respond and update the colors. It seems like it is slower on the second time around.

Is there any other option that anyone is aware of other than the draw item that could color a reading populated in the listbox?

 Private Sub ListBox1_DrawItem(sender As System.Object, e As System.Windows.Forms.DrawItemEventArgs) Handles LstReadingvalues.DrawItem
        e.DrawBackground()
        Try

            If _DisplayRAWValues = True Then
            Else
                Dim stringToDraw As Single = ((LstReadingvalues.Items(e.Index)) - _DataPosition(e.Index))
                If stringToDraw >= _PartfileProgram.PartfileSetup.USL Then
                    e.Graphics.FillRectangle(Brushes.Tomato, e.Bounds)
                ElseIf stringToDraw >= _PartfileProgram.PartfileSetup.UCL And stringToDraw <= _PartfileProgram.PartfileSetup.USL Then
                    e.Graphics.FillRectangle(Brushes.Yellow, e.Bounds)
                Else
                End If
            End If
            e.Graphics.DrawString(LstReadingvalues.Items(e.Index).ToString(), e.Font, Brushes.Black, New System.Drawing.PointF(e.Bounds.X, e.Bounds.Y))
            e.DrawFocusRectangle()
        Catch ex As Exception
        End Try

    End Sub

Open in new window

0
I'm using TreeView as my navigation. When i'm selecting the node i'd like to load UserControl on next panel near navigation. I'm starting an example work but i realize it's not logic way for coding. I have about 15-20 nodes and it means i will copy same logic code for 15-20 times. I didn't find a solution to make it easier if there will be a dictionary for (node,usercontrol) it'd be easy but i can't create such a dictionary.

My example code is like below.
    Private Sub treToolNavigation_AfterSelect(sender As Object, e As TreeViewEventArgs) Handles treToolNavigation.AfterSelect
        Dim node As TreeNode = treToolNavigation.SelectedNode
        Select Case node.Text
            Case "node1"
                Dim f As New UserControl1
                SplitContainer2.Panel2.Controls.Add(f)
                f.Dock = DockStyle.Fill
                f.Show()
            Case "node2"
                Dim f As New UserControl2
                SplitContainer2.Panel2.Controls.Add(f)
                f.Dock = DockStyle.Fill
                f.Show()
            Case "node3"
                Dim f As New UserControl2
                SplitContainer2.Panel2.Controls.Add(f)
                f.Dock = DockStyle.Fill
                f.Show()
        End Select
    End Sub

Open in new window

0
I'm using listview as WinForm control in my application. I'm using a single column list type but the problem is FullRowSelect property doesn't work with my application.

listView1.FullRowSelect = true

Open in new window


Does anyone has experience how can i use FullRowSelect feature?
0
I have a VB.net application that is dealing with clients bank accounts, I am trying to import a csv bank statement but obviously every statement is different.So to just look at a Comma Separated Value is great but there are also some banks IE that put commas in their descriptions.

Can you help below is the basic import i use:

 dgBR.Rows.Clear()
        Dim fName As String = ""
        OpenFileDialog1.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments
        OpenFileDialog1.FileName = ""
        OpenFileDialog1.Multiselect = False
        OpenFileDialog1.Filter = "Comma-seperated Values|*.csv"
        OpenFileDialog1.FilterIndex = 2
        OpenFileDialog1.RestoreDirectory = True
        If (OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK) Then
            fName = OpenFileDialog1.FileName
        End If
        Dim TextLine As String = ""
        Dim SplitLine() As String
        dgBR.ColumnCount = 9
        dgBR.Columns(0).Name = ""
        dgBR.Columns(1).Name = ""
        dgBR.Columns(2).Name = ""
        dgBR.Columns(3).Name = ""
        dgBR.Columns(4).Name = ""
        dgBR.Columns(5).Name = ""
        dgBR.Columns(6).Name = ""
        dgBR.Columns(7).Name = ""
        dgBR.Columns(8).Name = ""
        Dim Allocate As New DataGridViewButtonColumn
        dgBR.Columns.Add(Allocate)
        If System.IO.File.Exists(fName) = True Then
            Dim objReader As New System.IO.StreamReader(fName)
         …
0
Trying to use the stream writer to write data where the if the file is already created it will append the data.

 Try

            Dim reader As StreamReader = New System.IO.StreamReader(File.OpenRead("C:\ProgramData\ Test Stand\Data.csv"))
            Dim listA As New List(Of String)()


            If File.Exists("C:\ProgramData\Test Stand\Data.csv") Then
                File.Delete("C:\ProgramData\Test Stand\Data.csv")
            End If

            Dim sw As New StreamWriter("C:\ProgramData\Test Stand\Data.csv")
            Dim s As String = String.Empty

            While reader.Peek() >= 0
                Dim line As String = reader.ReadLine()
                Dim values As String() = line.Split(";"c)
                listA.Add(values(0))
                s = s + line + Chr(10)
            End While
            reader.Close()
            sw.Write(s)
            sw.Close()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

Open in new window

0
Hi all
this one put me the date with hour

SELECT max(CONVERT(datetime, fecha, 103))

i want it whitout hour
is any way
tsm you experts
regards
0
I have a crystal report, develop in VB.  In the details section you would see rows of records like the following.

TIme In  2:00 AM  Time Out  3:00 AM  Elapsed  0.00
Time In 3:05 AM  Time Out 4:00 AM  Elapsed 5 minutes

etc.

I want to calculate the elapsed time between the current record and the one sitting above it.  Records will be sorted by time out
0
Microsoft Azure 2017
LVL 13
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

I am working on a app that that two dropdownlist that autopostback.  My problem is when selecting my reset button
the autopostback dropdownlist does not reset. I am using a javascript in an attempt to reset the dropdownlist.

All other fields in the form reset except the dropdownlist and capthcha as well once the capthcha accepts the page.

There is a masterpage as well.

Any clues?

Isaac

<div class="form-group">
                    <div class="col-xs-12 col-md-8 col-sm-10 nill">
					    <asp:Label ID="lblSubject" runat="server" AssociatedControlID="ddlSubject" Text="Subject *" CssClass="control-label" />
					    <asp:DropDownList ID="ddlSubject" CssClass="form-control" runat="server" aria-label="Subject" required="required"  AutoPostBack="true" EnableViewState="true" OnSelectedIndexChanged="ddl_SelectedIndexChanged">
					    </asp:DropDownList>
						<span class="required"></span>
                        </div>
                </div>
                   
                  <div id="divQuantity" class="form-group" runat="server" Visible="false">
                       <div class="col-xs-12 col-md-8 col-sm-10 nill">
                       <asp:Label ID="lblQuantity" runat="server" AssociatedControlID="ddlQuantity" Text="Medicine Disposable Bags *" CssClass="control-label" />
                        <asp:Dropdownlist  ID="ddlQuantity"  CssClass="form-control" runat="server"  aria-label="Medicine Disposable Bags" required="required" AutoPostBack="true" 

Open in new window

0
Greeting,

I am converting and old VB6 program to VB.NET. Currently I am working on the function that takes a 'Listing File'  and uploads it to eBay. This function uses the eBay File Exchange API and has worked flawlessly for years within the VB6 program. I have modified/Converted it to VB.NET but I am still having some kind of issue with it. The API seems to execute fine but I receive the following error from the File Exchange 'Manager': "An unknown problem interrupted the file transfer. Please try again" The file that I am using as a test works fine and is uploaded to eBay  from the VB6 program so I am confident that the file is good with no syntax errors. I know that this might be a difficult task but hopefully another set of eyes can help me. I am including both function here for comparison.... Thanks in advance - Rick

------------------------------------
VB6
--------------------------------
Private Function PostListingsToEbay(UploadFileName As String) As String
        
    On Error GoTo MyTmpError
    
    Dim xmlHTTP As New MSXML2.ServerXMLHTTP40
    
    Dim MyBase64 As New Base64
    
    Dim XMLNodeValue As String
    Dim sContactURL As String
    Dim sUploadContents As String
    Dim sResponse As String
    
    Dim csUserNamePassword As String
    Dim sFileName As String
    
    Dim sEntityBody As String
    
    Dim MULTIPART_BOUNDARY As String
    
    Dim RtnVal As Integer
    Dim RtnValue As Integer
    
    RtnValue = MsgBox("Are You 

Open in new window

0
See environment below

Need VBA running in either Access (preferred) or excel which will add/delete a user to a sharepoint group and also list all members of a group into a table or excel sheet.

I've tried the OData approach for getting all users but unsure how to get it working in Access.

Environment: SharePoint 2013 - onprem, full control only (no SCA), and no farm access (no powershell).

VBA examples sought - not C##, powershell, ...
0
I am making my first attempt to use Google.Cloud.Translation.V2 in a VB.Net app.

I have installed the appropriate library using NuGet.

My code is:

Imports Google.Cloud.Translation.V2

Public Class Form1

  Private Sub Translate()

    Dim GClient As TranslationClient
    Dim GResult As TranslationResult

    GClient = TranslationClient.Create()
    GResult = GClient.TranslateText("This is some text to translate.", LanguageCodes.German)
    MsgBox(GResult.TranslatedText)

  End Sub

  Private Sub butTranslate_Click(sender As Object, e As EventArgs) Handles butTranslate.Click

    Translate()

  End Sub
End Class

Open in new window


I have created a service account key and downloaded the JSON file to the root of my C: drive, then I added the following environment variable:

GOOGLE_APPLICATION_CREDENTIALS=C:\My First Project-fcf4f0971c53.json

Open in new window


When I run the above app, I get:

Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.'
What am I doing wrong?
0
Dear Experts,

My application doesn't  detect and replace old versions during re-installation/update I am using VB.NET
0
The code below to send email doesn't send all the attachments,

It the attachments are three it sends two, they are two it sends 1 and it is one it sends 1. it sends attachments minus 1 except for 1


   Private Sub FpSpread1_ButtonClicked(sender As Object, e As FarPoint.Win.Spread.EditorNotifyEventArgs) Handles FpSpread1.ButtonClicked
        Dim Smtp_Server As New SmtpClient
        Dim e_mail As New MailMessage()
        Try
            Dim afile As Attachment
            Smtp_Server.UseDefaultCredentials = False
            Smtp_Server.Credentials = New Net.NetworkCredential(emailname, emailpw)
            Smtp_Server.Port = 587
            Smtp_Server.EnableSsl = True
            Smtp_Server.Host = "smtp.gmail.com"
            e_mail = New MailMessage()

            With FpSpread10.Sheets(0)
                For i As Int16 = 0 To .RowCount - 1
                    If (.Cells(i, 1).Text & "").ToString.Trim.Length > 0 Then
                        afile = New Attachment(.Cells(i, 1).Tag.ToString, MediaTypeNames.Application.Octet)
                        e_mail.Attachments.Add(afile)
                    End If
                Next
            End With

            e_mail.From = New MailAddress(emailname)
            With FpSpread8.Sheets(0)
                For i As Int16 = 0 To .RowCount - 1
                    If (.Cells(i, 0).Text & "").ToString.Trim.Length > 0 Then
                        e_mail.To.Add(.Cells(i, 0).Text)
                    …
0
I work in a VB.Net shop. The branch of the company I work for odes a great deal of mailing and as such use IMB Barcoding. We need to use a dll provided by USPS and from everything I have found in my research it is not compatible with Visual Basic, .NET or otherwise. The dll provided by USPS is USPS4CB.dll, which was written in C.

I refuse to believe that some great mind out there hasn't found a way to access the dll and use its functions. I have found some references in my research to a compatible version of the dll that was provided to someone by USPS, but have no way of obtaining it.
I either need to figure out either how to import and use the dll in VB.Net or how to obtain a compatible version of the dll.
0
I am trying to access a particular website using a VB.net app and a WebBrowser component in that app.

I want to click a link on the page, which uses JavaScript and failed to do so programatically. It was then that I discovered that even when clicking the link directly with the mouse it does not work. The links work fine in conventional web browsers, but not in the WebBrowser component.

I have no control over the destination website.

The HTML for the link in question is:

<a href="javascript:;" class="ellipsis" onclick="fn_detailView('0095000', '00010', '20190315', '1')">(주)유한양행</a>

Is there a way I can "fix" the WebBrowser component with respect to this website, or can I directly call the JavaScript function specified in the link?
0
How do I easily passing information from a database to  model and then to the view without using binding, i am using mvc 4.0
0
PMI ACP® Project Management
LVL 13
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

How do I allow users of my application developed in VB.NET to send email using the application?

The application generates an invoice, I would want the user to send that invoice through the application and using his email account as a form address.

Thank you, Anthony
0
I am using Visual Studio 2008 for developing a project in VB.NET .  I have built a report using crystal reports (in Visual Studio 2008) in the project which contains Barcode.  I had assigned code 128 AB Tall as the font but when I try to export it to PDF it generates ERROR.  I then tried the font Code 128, this time it got exported to PDF correctly but when I tried to read the barcode through barcode scanner, it won't get read.

I shall appreciate Insights to resolve the above situation.

P.S : I am attaching the snapshot the the error I am encountering during the export.

Thanks.Barcode-Error
0
I am using Treeview in Asp.net with VB, I am using Asp.net tabs and in one of tab, treeview is binded, When I select treeview node item then it gets focus and scrolled so it's visible in treeview, When I change tab and come back on treeview tab then last selected node remain selected but focus don't come, is there anyone to find selected node and set focus into that? How to get focus on Treeview node. Please help.
0
From the reading pane of Outlook, I would like to quickly copy the contents (body and header) of a highlighted email messages to be able to paste into a work order system.

Is there a way to do this with Quick Steps or would I need a macro?

I can semi-manually do this by hitting Reply then CTRL+A and erasing my signature at the top of the reply, but it gets tedious.
If there is a way to reply without Signature when using the macro/quick step (without changing my signature preferences), that would be ideal.

Thanks!
0
Looking at integrating a vb.net application to pull orders from a web API. In the past I have added a reference and used the WSDL. The software I am trying to integrate is:

http://docs.handshake.com/?json-doc#quickstart

It would be better if I could use a WSDL type integration but from the documentation it looks like you have to do a HTTP request.

Really looking for the best way to move this forward. don't know if I should use the HttpWebRequest.

The documentation says :
# Use the command below to dump the JSON data for your orders. Replace the `2c493d74` with your own API key (which will be much longer)
curl -u 2c493d74:X "https://app.handshake.com/api/latest/orders"


I am a bit unsure if I keep my httpwebrequest as:        
Dim myRequest As HttpWebRequest = CType(WebRequest.Create("https://app.handshake.com/api/latest/orders"), HttpWebRequest)

If I try and anything else it fails. I can call myRequest.Credentials but is this what I should be trying to do?


Best Regarsd,

Ross
Example.JPG
0
I am using infragistic Web datagrid with .
I need to drag and drop grid rows in same grid.

Please provide solutions
0

Visual Basic.NET

93K

Solutions

24K

Contributors

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to  Visual Basic pre-2002, it is not the same technology,