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
0answers
31 views

Validate (Possible) File/Directory Path

I am working on a "comprehensive" library for use in my internal applications and I have created a working method (as far as all of my testing has shown thus far) to ensure that a file/directory path ...
1
vote
1answer
24 views

Assigned a System resource to an image based on variable

I have a mapping application and the marker I'm using is based on the field rep assigned to that visit. My code is just a Select Case based on the rep's name and then it sets the bitmap for that ...
-2
votes
0answers
16 views

From Object to Json String Refactoring [closed]

I need to refactor the below code because i think that there will be a more easy way to write it down can someone help me ? the code create a json string using the value of the lclrow class. I need ...
2
votes
0answers
26 views

Inherited class calls initialization code in base class [closed]

I am interested in hearing your opinion on the approach I have taken to have inherited classes initialize their base class. Here's a Machines collection class from that maintains a list of Machine ...
1
vote
1answer
17 views

Cascading interfaces for wrapping VSTO Microsoft.Office.Interop

I have created my own wrapping framework for the COM interfaces exposed via Microsoft.Office.Interop. MIRRORING WRAPPERS The first purpose is to be able to unit ...
4
votes
1answer
73 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 ...
0
votes
1answer
1k 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 ...
4
votes
1answer
32 views

Use a delegate to assess equality

I have built my own generic class to implement IEqualityComparer(Of T), which takes a delegate as an input for the constructor. This delegate takes two objects of ...
5
votes
1answer
561 views

HackerRank ACM ICPC Team

You are given a list of \$N\$ people who are attending ACM-ICPC World Finals. Each of them are either well versed in a topic or they are not. Find out the maximum number of topics a 2-person team can ...
1
vote
0answers
24 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
217 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 ...
1
vote
1answer
46 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 ...
3
votes
1answer
99 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
43 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 ...
2
votes
1answer
137 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 ...
1
vote
1answer
51 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 ...
0
votes
1answer
13 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 ...
6
votes
3answers
679 views

Shutdown Delay Program

I wrote this program a while back that would allow me to set a delay, say 3 hours, and when the delay had expired, my PC would turn off. The purpose of it was so I didn't have to leave my PC on all ...
3
votes
0answers
110 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 ...
4
votes
2answers
153 views

Setting fields, with default values, before saving a row

I would like to find out if there's a cleaner way to go about validating input before it goes into a function. What I'm doing seems like a lot of code, I'm sure there's a better way. I would also ...
2
votes
0answers
41 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 ...
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,...
1
vote
1answer
43 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 ...
1
vote
2answers
63 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 ...
4
votes
2answers
202 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. ...
2
votes
0answers
69 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: ...
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 ...
4
votes
0answers
139 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 ...
1
vote
1answer
37 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
76 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
66 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
2answers
307 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
37 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
73 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 ...
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
97 views

Retrieving XML data

I am using the following function to receive XML data from a URL. Is there a more efficient method for retrieving this XML data? ...
2
votes
0answers
64 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
54 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
120 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 (...
2
votes
1answer
206 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. ...
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. ...
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 ...
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 ...
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 ...
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....
4
votes
1answer
729 views

Matrix rotation

Continuing on my VB.NET quest, I came across this slightly more challenging problem. You are given a 2D matrix, a, of dimension \$M\$x\$N\$ and a positive integer \$R\$. You have to rotate the ...
6
votes
4answers
275 views

Fizzbuzz of course

My second attempt with vb.net - I tried taking the advice from yesterday's question into consideration, but I did not try using LINQ. You know the drill: A programming challenge that prints the ...
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 ...
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 ...