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
2
votes
2answers
463 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
87 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
82 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
157 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
62 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
163 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 (...
4
votes
2answers
4k 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
63 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 minimum ...
5
votes
2answers
75 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
118 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
43 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
82 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
91 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
51 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 ...
6
votes
1answer
3k views

VB.NET class for MySQL CRUD

I wrote this code for 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, return ...
3
votes
1answer
78 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
527 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
65 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
54 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
110 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
4k 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
192 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
432 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
646 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
236 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
283 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
305 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
1k 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
53 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 ...
2
votes
1answer
255 views

Building a very basic calculator

I have been a VB developer for couple of years, but strictly using functional programming paradigms — I just started using object-oriented paradigms a few days ago, and want some advice on how ...
1
vote
0answers
30 views

Copy / paste special excel row

This is part of Invoice. If I have 20 items of it I need to copy nth row (because end user set format only on few cells in nth row) so to keep it formated I need to copy entire row and paste it ...
2
votes
0answers
276 views

Passing a form reference for accessing control in other class

I have a form and one other class that basically maintains initialization state of the form (in this case, loading data from Json file to controls in form). My form code: ...
5
votes
2answers
2k views

Create URL query string from dictionary

I have a dictionary of parameters and value, and the function creates a URL query string from it: ...
0
votes
1answer
71 views

Simple property formatting

In a VB.Net class, I have an method that replaces all square brackets [] in certain properties by normal brackets (). Edit: The ...
2
votes
2answers
92 views

How to avoid code duplication in ordering system

Here is the piece of order system. And this is hierarchy of order classes in this system ...
2
votes
1answer
144 views

Marshaling to a complex structure in .net

This is a follow up from question https://stackoverflow.com/questions/45106245/net-file-random-access-recoard-locking I have been able to make the reading and marshalling work ok but the performance ...
2
votes
0answers
57 views

Updating Excel sheet with information from a DataTable

Basically, I'm trying to update an excel sheet using a DataTable (The columns structure between the two are not the same) with respect to the following rules: ...
2
votes
1answer
137 views

Numbers to words

A bit of code I made in VB.NET to convert the digit form of integers into words. I've intentionally assumed that inputs will match the desired format since the focus of this task for me was to ...
4
votes
1answer
186 views

Abelian sandpile

I am trying to programm the Abelian sandpile model in VisualBasic. Also, here is a youtube video made by Numberphile about the very same topic. Here is a picture (\$2^{20}\$ grains of sand) I made ...
0
votes
1answer
22 views

Padded Version.ToString() extension

I want to convert a Version object to a string, but with the parts padded to a given width. E.g. 0.22.1 with parts padded to a ...
1
vote
1answer
61 views

Read date from a file and rename two files using the date

Problem I have image files that are RAW data and have the extension .NEF Whatever edits I make to these files are stored in what is called a sidecar file with the ...
1
vote
1answer
72 views

Recursive function to merge 3D objects

I have several 3D items in listOri. For this example: listOri has A,B,C,D,E. A overlaps with C. B overlaps with D. D overlaps with E. I have a recursive ...
1
vote
1answer
48 views

SQL subquery to determine whether or not a particular row is the first item that matches the subquery

Here is my VB.NET and SQL query (which is one of the things I'm particularly interested in having critiqued): ...
2
votes
0answers
75 views

LightsOut - A homework framework for teaching CS to non-engineers

This provides a fill-in-the-blanks homework framework to implement the game "LightsOut". LightsOut is a game with a grid of lights. When you touch a light, it toggles it’s state; it ALSO toggles the ...
1
vote
1answer
67 views

Optimize Arraylist function call

I am using the following to retrieve some user info based on IP address. ClientLocation() returns an array with city, state and coordinates. My concern with this ...
1
vote
0answers
225 views

Optimizing Levenshtein Distance with nested loop

Brief illustration: I have 2 classes - tbCustomer and tbDHN which is stored inside a list....
6
votes
1answer
2k views

AES encryption/decryption using pure .NET and streams

I'm trying my hand at simple encryption and decryption. Ideally I'd like to be doing it the 'right' way, ie something secure without doing it in a way that will have a serious hole. I'd prefer to do ...
1
vote
2answers
658 views

Find and display the position of a word in a sentence

How can I simplify this code: ...
2
votes
1answer
305 views

LinQ wrapper to get distinct items from a IEnumerable based on a function of item

I often need to perform LinQ queries to get distinct items from a IEnumerable based on one of its properties. I would like to know if this is a good way to wrap this operation: ...

1
2
3 4 5
7