Questions tagged [vb.net]

Visual Basic .NET (VB.NET) is an object-oriented computer programming language that can be viewed as an evolution of Microsoft's Visual Basic 6 (VB6) but implemented on the Microsoft .NET Framework.

Filter by
Sorted by
Tagged with
1
vote
0answers
17 views

Console app to get XML from API and save to database

I am making a small console app to get XML from an API and then save the data to a database. While this project was not created via test-driven-development, I have tried to make it such that tests can ...
8
votes
2answers
1k views

ROT13 encoder/decoder

This is a simple utility, intended to sit on the desktop for when needed, that does the simple ROT13 encoding and decoding. I am used to coding in VBA, and I am interested in more .Net idiomatic ...
7
votes
3answers
203 views

Convert integer to full text string duration

I have a function I have written in VB for use in SSRS 2012. It takes an integer and converts it to full text duration - for example 900 becomes "15 minutes", 9000 becomes "2 hours 30 minutes", and ...
2
votes
1answer
40 views

Encrypts using AES GCM for data with limited visibility and long rest

This is the third iteration of my venture on creating an encryption/decryption solution. I asked a question here, which led to this question here, which led to this answer here, which led me to ...
1
vote
1answer
47 views

Encrypts using AES with random initialization vector meant for data with limited visibility and then long rest

I've done some research, reviewed countless SO questions that appeared similar, leading me to endless rabbit holes. My solution is working, but I don't like it. I want to create a random IV for AES ...
1
vote
1answer
34 views

Optimization - open excel file from VB.NET using interop

I have a simple app, which is something like a launcher for my macro enabled excel workbook. I made it for easier distribution, to be able to check if excel installed and also to make it look and ...
2
votes
1answer
115 views

Interactive auction board

An exam requires me to create a program for an interactive board for an auction: An auction company has an interactive auction board at their sale rooms, which allows buyers to place bids at any ...
0
votes
1answer
12 views

Efficiently centralise and manage Groups of Features (aka “lines of services”)

I mostly develop AddIns for Office. In the example of MS Word, I have an AddIn which allows to review drafting style, another AddIn which allows to monitor cross-references, another Addin which allows ...
3
votes
0answers
82 views

Verify OpenSSL RSA signature (PHP) with .NET (VB)

I would like to achieve something I believe is pretty standard: A) My VB.NET client (ideally targetting Framework 4.0) sends a text string to my Apache/PHP Server via an HTTPS POST request. B) My ...
1
vote
0answers
39 views

Iterating over combinations

Background The following describes the real world problem that my code is intended to solve. It is may help you understand what the code is doing and why. I don't think this is strictly necessary in ...
2
votes
0answers
38 views

vb.net Create textfile from template

What is the best approach for creating textfiles from/with a template ? Currently I just read the template from a textfile and Replace all values needed, but I don't think that this is the most solid ...
1
vote
1answer
40 views

Function to return the closest Date to Today (inclusive) from Ordered list

The way I've written this feels clunky. Particularly, it feels like I shouldn't need to have both a 'dateToCheck' and 'selectedDate' variables. The objective is to find the Date in a list that is the ...
4
votes
2answers
185 views

Detect file type using file signatures

My program has to detect the real file type of a given file using signatures. For now I'm just checking JPG, but I want to add more. ...
1
vote
2answers
56 views

Outlook VSTO: Fastening email loop on a large pst file

In a Outlook VSTO Addin I needed to loop through a large pst file (e.g 30GB containing 50k+ mails). Following code block loop the pst file folder by folder recursively. It takes huge time (1hour+) to ...
2
votes
0answers
66 views

One class for MySQL and MSSQL Queries

EDIT BELOW I am trying to create resusable classes for MSSQL and MySQL queries (later also Update and Delete queries). I tried it doing the OOP-way. Here is my result: Einstellungen.vb: ...
4
votes
0answers
137 views

Comparing two instances of a class

I have a Calculation class. It is persisted in the DB and users can modify it. The aim of the CompareWith function is to ...
3
votes
1answer
39 views

Tone Mapping image manipulation

This code is extremely slow and ideally I would appreciate someone walking me through getting this going on the GPU, but if nobody has time for that which is understandable, any and all optimisations ...
0
votes
1answer
901 views

Digital persona fingerprint verification takes a lot of time

I'm using Digital Persona U.are.U 4000b fingerprint reader and I have this function that verifies the fingerprint from SQL server My problem is the loop because it takes a lot of time to compare the ...
1
vote
1answer
36 views

Split a big file into two and then merge back into the original

After searching and reading some threads (1, 2, 3, 4 and 5) on how to split a big file into smaller ones and then merge them back into the original one I made the following VB.NET code on an empty ...
3
votes
1answer
74 views

Replace a^b by Pow(a,b)

The application uses NCalc to execute diverse calculations. The 'natural' way to write powers using a computer is using the ^ symbol. However, NCalc already uses ...
2
votes
2answers
278 views

Substring a String from given start index and given substring length

I want to substring a String from given start index and given substring length. if the string is empty then returns String.Empty if the string length is greater than start index then it substrings ...
3
votes
0answers
35 views

TextFileConvert - dos2ux and ux2dos in VB.NET

This provides text file conversion capabilities like the common Unix utilities "ux2dos" and "dos2ux". I needed the capability to perform Unix text file conversions, round trip, within a VB.NET ...
2
votes
1answer
71 views

Determine if 1 Queen can take King

This challenge was pretty simple - be given the coordinates of a king and a queen on a chess board and determine if the king is in check. Input is the number of test cases with each test case on a ...
2
votes
0answers
61 views

Recursive/traversal search of items using EWS managed API in subfolders too

I would like to know if there's a more efficient way of querying items than this (that works, though): ...
0
votes
1answer
53 views

Using Try & Catch to solve exception [closed]

I am working on a ADDIN that works on 3D drafting program. This ADDIN has historically grown and now I am doing a big rewrite. During this rewrite I came across a issue. I have 2 (fairly similar) ...
3
votes
0answers
111 views

Custom task timer

This code (Windows Forms) shows a series of timers so that the user can manually time a series of tasks. I decided to put this together today because next weekend I want to go through an activity (...
3
votes
2answers
2k views

AES File Encryption / Decription VB.NET

I've been looking for a while for the right code to encrypt/decrypt files with AES in vb.net. I created the code below. Is this the right way doing AES encryption/decryption nowadays? ...
2
votes
1answer
53 views

Dynamic programming to solve two printers with different speeds

I solved this problem using a Class, but thought I might try to figure out this memoization thing. Problem There are two printers that print pages at different speeds (X, Y). What is the ...
5
votes
2answers
72 views

Inputting 10 numbers in an array

I would like some tips on how I could simplify my code. Basically what I am trying to do is to input 10 numbers in an array but this looks messy so I am trying to change it to look less messy. ...
6
votes
1answer
81 views

Drawing circles from array to a Form

I've actually been struggling with painting with VB.Net for a few weeks. All I know is that I shouldn't use CreateGraphics if I can avoid it, so I've done just that....
2
votes
0answers
38 views

Interface approach of logging channel and exclude of specific log channels

I have library which sending/logging information by diffrent log channels like by email, sms or save to file. It works fine but i would like to get your opinion and get code review regarding my ...
2
votes
2answers
65 views

Warehouse/store management tool

I'm learning VB.NET for work reasons, and I'd like to ask your help to improve my coding and my programming skills. What can I do better? The program will be used to store data in the DB, like how ...
2
votes
4answers
85 views

Generating N Prime Numbers

I'm trying to generate N prime numbers where my N = 200,000. The method that I think I wrote is - Start with first prime of 2 Increment possible prime number by 1 See if possible prime is ...
5
votes
1answer
48 views

Tidying and deduplicating files listed in a DataGridView

I have the following code that searches through folder directories in a DataGridView table, and puts all files of the wanted format into a list, it also gathers a list of their last modified date for ...
5
votes
1answer
2k views

VB.NET class for MySQL CRUD

I've been using this code in a few basic CRUD (Create, Read, Update, Delete) applications, but I think it can be improved and refactored. I have 3 SELECT type functions(return a table, return a value,...
3
votes
1answer
60 views

Find matching image and metadata files, pull data and rename both

My Original - Read date from a file and rename two files using the date github if you want to see behind the scenes. I like taking pictures of birds. Lots of pictures of birds. My camera counts ...
0
votes
2answers
302 views

VB.NET - Error Handling in Generic Class for PDF Merge

As a part of a project I'm working on, a new requirement has arisen for me to be able to generate multiple PDF files and then merge them together before they are delivered to our client(s). For this, ...
1
vote
1answer
56 views

Class Property Definition to Prevent Unnecessary Database Calls

The challenge I'm facing is creating a class for a Loan object which contains a number of properties, some of which are classes in and of themselves with similar ...
2
votes
1answer
47 views

Documenting and commenting code using xml tags

I am going to rewrite my AddIn I made for the Autodesk Inventor software. It is supposed to do specific task that are not available by default in the program. I am not a programmer but a draftsman ...
3
votes
1answer
97 views

Unit test for a method that populates a dictionary from an API call

I am building a unit test for a method that populates a dictionary from an API call (responding with JSON): ...
2
votes
1answer
2k views

Function to check empty cells found or not in Datagrid

I want to check if any empty cells found or not in a Datagridview when save data to database, so I've written this function: ...
2
votes
0answers
185 views

Draw a panel control with a sunken look

I am relatively new to visual studio. I am in the process of creating a custom control and the same time learning. I have put together the beginning of this control and will love to get some input. ...
1
vote
3answers
268 views

Deck Shuffling Method

Just wondering if you guys think this is a good way to shuffle a deck or a bad way. Updated to show the GetRandom function as requested. ...
3
votes
1answer
476 views

Service calculator! (Tax and tip)

Here is a simple calculator for calculating the tax and tip of a transaction. I have tried to add input verification. I am wondering if there are more elegant ways of doing some simple tasks that are ...
1
vote
0answers
142 views

Read data from Google Sheets API and populate a class

I have data stored in a Google Sheet. The aim of this program controller is to read this data from an MVC controller, and populate a class (Model) with it. I will skip most of the intermediate ...
20
votes
2answers
3k views

Search a big (13 GB) Outlook PST file

I have an Outlook PST file of a pretty big size (13 GB). For some indexing purpose I needed to scan through the full PST file to get all the PR_SEARCH_KEY and then ...
2
votes
1answer
200 views

ETL project, handling XML, CSV, and text files

I have completed an ETL project to collect, parse and load files. I decided to make it clean OOP way using interfaces and abstract, but have some questions below. ...
2
votes
0answers
191 views

Binary addition in VB.net

It starts by taking two user input from the console and putting them into strings. I then pad them to get them to the same length. I get the length of the num1 and assign it to the integer len. I then ...
0
votes
2answers
221 views

Function to test whether file is in use

I needed a method to test whether a given file is in use. Is the code below up to the task? ...
0
votes
0answers
49 views

Extract value from a database and populate objects

I have a database, with some history data for a lot of tags (ie. measurement points in the plant). Users supply a calculation script, and get the result of the calculation as a result. The main ...