Love this guy. Very simple - no BS - just code. I’ve been programming for 41 years and this is exactly what I need to get on my feet. I’ll bust programs into subroutines and design systems based upon my experience. UDEMY courses are good - but they teach you what they want you to know - not what you need to know. Thank you man. Love the Aussies.
Thank you so much. I starting to code in 2019. I lean qvery fast. Right now I'm making a game in Visual Basic. Without your video I would have given up on my game. Thank you so much and you are GOD.
THANK YOU SO MUCH SIR NICHOLAS DINGLE, I always thought filing was hard until I watched this video and managed to solve 3 to 4 tasks in my pre release exam paper for computer science 9608 ( keep up the good work!!!!!)
mate you're a fucking legend, I didn't have a fucking shit stain of an idea what append did but you are my shining light in the darkness, you showed me the way. I will build temples for you and we will worship you for years to come. The night is dark and full of terrrors
Man i have to say thank you so so so much for this amazing tutorial, it is very understandable and you have amazing way to teach, good job and i wish you best .
Hi Nicholas, I have written program to create text file in the native folder in which my application installs(eg. c:/). I successfully generated setup file and i am able to install it but when i run it, it popups with "access to the is denied" message
If i want to pass an object variable to a text file, but not delete the previous entries how would i do it. It is for a little log. so ill pass a date/log number from 0 to 600 and time
Awsome tutorial. I have been struggling to find any vb console tutorials on how to import information from a CSV file into a 2D array. would you mind making one?
great! it's simple favor, i would like for you to edit. i have this screen capture code which i am trying to get it to save the screenshots with the same file name without over writing the other, egs screenshot1, screenshot2, screenshot3 all in the same folder with the same filename but count with 1 at the end. here is the code: If Not Directory.Exists(ScShot & "\ScreenCapture") Then Directory.CreateDirectory(ScShot & "\ScreenCapture") End If If Directory.Exists(ScShot & "\ScreenCapture") Then Try Dim screenshot1 As Bitmap Dim graph1 As Graphics screenshot1 = New Bitmap(Screen.PrimaryScreen.Bounds.Size.Width, Screen.PrimaryScreen.Bounds.Size.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb) graph1 = Graphics.FromImage(screenshot1) graph1.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy) Dim path As String = ("C:\Users\" & Convert.ToString(Guid.NewGuid()) & "\Documents\ScreenCapture\Screenshot" & ".png") screenshot1.Save("C:\Users\" & SystemInformation.UserName & "\Documents\ScreenCapture\Screenshot" & ".png", System.Drawing.Imaging.ImageFormat.Png) 'Timer2.Start() Timer1.Stop() Catch error_q As Exception MsgBox(error_q.ToString) End Try End If
That's not too bad, just use a while loop with a counter. Check if the file exists, if it does move to the next number and check again. Also note below I use SpecialDirectories to get the My Documents folder. Dim fileCounter As Integer = 1 While IO.File.Exists(My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\ScreenCapture\Screenshot" & fileCounter & ".png") fileCounter += 1 End While
Hi Nicholas, may I please ask how I would go about loading data from a text file that has delimiters. All the information online is really complicated and I can't quite understand it! I have saved an array into a text file, separating the contents with commas and what to load it again to be displayed in VB. Thank you!
I won't be able to write the code, but you'll be using LineInput() to get it line by line and then use .Split() on your strings to cut it up by commas. Give those functions a Google and you can find out.
hahaha poo folder FTW, thanks for the tutorial, keep making vids, even if just updates of old tutorials showing new ways to do them, because its real bloody hard to find any good ones
+Nicholas Dingle did you get access to the link? also i need your help with this code. can you give me a function able code to run a bat file from the resource in vb.net using the special directory methods? i added a bat file to my app resource and using a lot of methods to call it but it's not working, what i am trying is to do is to program my app to start a .bat file in it's resource with special directory method so that the app can be able to run an any pc without have to search the c drive a path with the bat file location, the app is a keygen.
how the file properties were given? I am getting an error :- Error 1The name 'FileOpen' does not exist in the current context Error 2 The name 'FileOpen' does not exist in the current context
+Shania Sooranna If you created the file in VB.NET with just the filename "hello.txt" then it should be inside your Debug folder, which you'll find "Project Folder\bin\Debug"
Hi NIck, that's a very interesting tutorial, it's really very helpful to me, but please i need to know how do i read only a specific number of items (say 120 items) from CSV file that has almost 800 items? Regards
i ahve a textbox where i write in a word. Lets say a write Hello in it. When i press the button i want the programm to check if the word hello is in the textfile. I have multiple words in the textfile. i ahve "hello" "bye" and "one" in it. How can i let the programm search for a match? btw the textfile is on dropbox
This is a massive question really. You can use a function called IO.File.ReadAllLines("myfile.txt") which will pull all lines from a text file into a Array of Strings. You can then loop through the array and check if the words you need are in it. If you mean that you want to download the file from Dropbox prior to opening it you need to look at WebClient.DownloadFile("myfile.txt")
I'll admit it's been a long while since I made this video and I forget where I used the ToUpper function. But ToUpper is good to convert characters in a string into all uppercase letters. Then it's easy to compare strings using if statements.
Thanks for the tutorial! I do have a small question... Which option do I have to select in the program to also get this 'suggestion/explanation message boxes' you get at for example 4.57
Thank you for your reply, but it is actually this parameter suggestion box that I am curious about. when I write code is doesn't 'come up'. Do you know whether this is something you can turn on and off?
hey nicholas, i have a two solution project. in solution two, i have classes and module that i want to used in solution one but the two project is not linking. when i am in solution two all the class and modules show up in the toolbox but in solution one it's not. what do you think i am missing out?
I'll assume you have two projects in one solution and that project two contains code for project one. You need to open My Project for project one and go to references. Add project two in there. After that down the bottom, tick the name of project two and you're good to go
hello nicholas.my name is khairi and im from malaysia. i would like to ask you on how to make a vb program. there are 1000line of data in notepad. then user want to devide the 1000 line into whatever number their like using vb hope u can help me
Hello there Sir, I was wondering if you could help me out with accessing the binary files in random mode, i already know the method to access the file using Stream method but i am not able to do it by FileOpen method.. BTW.. You Rock..
You can't actually use FileOpen and Stream at the same time. They are different generations of technology. I'm almost certain that under the hood, FileOpen would be using Streams. Depending on what you want to do I would go down the Stream method or using the File.ReadAllText methods. Hope I helped you there.
Thanks for your quick reply.. I just want to put data into file and use Hash function to calculate the record starting position.. and read from the same position..e.g file.position = hash(thisfile.name) i amm not familier with ReadAllText method.. can you suggest any good book for console programming?
Hi NIck, that's a very interesting tutorial, it's really very helpful to me, but please i need to know how do i read only a specific number of items (say 120 items) from CSV file that has almost 800 items? Regards
Love this guy. Very simple - no BS - just code. I’ve been programming for 41 years and this is exactly what I need to get on my feet. I’ll bust programs into subroutines and design systems based upon my experience. UDEMY courses are good - but they teach you what they want you to know - not what you need to know. Thank you man. Love the Aussies.
Thank you so much. I starting to code in 2019. I lean qvery fast. Right now I'm making a game in Visual Basic. Without your video I would have given up on my game. Thank you so much and you are GOD.
VERY VERY USEFUL! UNDERSTOOD THE WHOLE FILEHANDLING!!!!
MAY GOD BLESS YOU! AMEN!
THANK YOU SO MUCH SIR NICHOLAS DINGLE, I always thought filing was hard until I watched this video and managed to solve 3 to 4 tasks in my pre release exam paper for computer science 9608 ( keep up the good work!!!!!)
Sounds awesome, hope you go well in the exam.
this is the best tutorial i found here on file handling
mate you're a fucking legend, I didn't have a fucking shit stain of an idea what append did but you are my shining light in the darkness, you showed me the way. I will build temples for you and we will worship you for years to come.
The night is dark and full of terrrors
you know nothing.....
You are a very good teacher, Nicholas. Well done.
Just *subscribed*. I've been looking for help like this for my AS levels, and your videos are perfect for what I am making! Thanks *so* much :)
DowzerWTP72 No worries, thanks for the comment
Same
excellent demonstrations, I was having trouble trying to read/write some files to use and reuse in my programs for various subs/functions. thanks!!
Just what I needed! Thank for taking the time to record / share this tutorial!
Anytime!
the best vb tutos on RUclips thanks
Just found this today, saved my life buddy. Thank you very much
Man i have to say thank you so so so much for this amazing tutorial, it is very understandable and you have amazing way to teach, good job and i wish you best .
+Hesham AL-Ahdal (L.R.G) No worries, thanks mate!
These tutorials are exceptional. Thank you.
Nice work. Very effective for my academics. Thank u.. keep doing like this.
Hi, how do I get specific lines from the file?
For loop till the line you want, i guess?
u have saved my life for the a level exam
thank God I found your channel, dude!!!
Hi Nicholas, I have written program to create text file in the native folder in which my application installs(eg. c:/). I successfully generated setup file and i am able to install it but when i run it, it popups with "access to the is denied" message
Really Great Video. You earned yourself a subscriber.
I have a stupid question, since I was a beginner, why the syntax in visual basic "Not equals to" is same as "equals to in the video?
Great video. Do you by chance have any videos about populating listviews from external text files in VB?
If i want to pass an object variable to a text file, but not delete the previous entries how would i do it.
It is for a little log. so ill pass a date/log number from 0 to 600 and time
What you're looking for is Append. Append works like Output, but doesn't delete the file's original contents.
+Nicholas Dingle Thanks
After 1 Hour I found You Lol.
why did u not simply write If input.ToUpper = ''STOP'' Then PrintLine(1, input) at 14:07 instead of ''STOP'' ps iam new at programing
How can I look for a specific part of a file and cut it and a few character after it out.
Do you know the line number? If so, read that many lines and then use the SubString function.
When using form and textboxes how would i get it that the username and password are stored on the same line but separated with a comma
Read the text into a string and then check out the split function - www.dotnetperls.com/split-vbnet
Awsome tutorial. I have been struggling to find any vb console tutorials on how to import information from a CSV file into a 2D array. would you mind making one?
That's a great idea, I'll add it to my video ideas.
hey friend! remember me?
+george gallimore sure do
great! it's simple favor, i would like for you to edit. i have this screen capture code which i am trying to get it to save the screenshots with the same file name without over writing the other, egs screenshot1, screenshot2, screenshot3 all in the same folder with the same filename but count with 1 at the end.
here is the code:
If Not Directory.Exists(ScShot & "\ScreenCapture") Then
Directory.CreateDirectory(ScShot & "\ScreenCapture")
End If
If Directory.Exists(ScShot & "\ScreenCapture") Then
Try
Dim screenshot1 As Bitmap
Dim graph1 As Graphics
screenshot1 = New Bitmap(Screen.PrimaryScreen.Bounds.Size.Width, Screen.PrimaryScreen.Bounds.Size.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
graph1 = Graphics.FromImage(screenshot1)
graph1.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy)
Dim path As String = ("C:\Users\" & Convert.ToString(Guid.NewGuid()) & "\Documents\ScreenCapture\Screenshot" & ".png")
screenshot1.Save("C:\Users\" & SystemInformation.UserName & "\Documents\ScreenCapture\Screenshot" & ".png", System.Drawing.Imaging.ImageFormat.Png)
'Timer2.Start()
Timer1.Stop()
Catch error_q As Exception
MsgBox(error_q.ToString)
End Try
End If
That's not too bad, just use a while loop with a counter. Check if the file exists, if it does move to the next number and check again. Also note below I use SpecialDirectories to get the My Documents folder.
Dim fileCounter As Integer = 1
While IO.File.Exists(My.Computer.FileSystem.SpecialDirectories.MyDocuments &
"\ScreenCapture\Screenshot" & fileCounter & ".png")
fileCounter += 1
End While
In the same way can we read excel files or csv files
Part 2: 16:12 :) you're welcome
Hi Nicholas, may I please ask how I would go about loading data from a text file that has delimiters. All the information online is really complicated and I can't quite understand it! I have saved an array into a text file, separating the contents with commas and what to load it again to be displayed in VB. Thank you!
I won't be able to write the code, but you'll be using LineInput() to get it line by line and then use .Split() on your strings to cut it up by commas.
Give those functions a Google and you can find out.
hahaha poo folder FTW, thanks for the tutorial, keep making vids, even if just updates of old tutorials showing new ways to do them, because its real bloody hard to find any good ones
Could we use a try and catch error handling with finding if there is a file or not?
+Examine Studios You can but it might just be easier to use the IO.File.Exists. Since the try and catch will find all errors
+Nicholas Dingle did you get access to the link? also i need your help with this code.
can you give me a function able code to run a bat file from the resource in vb.net using the special directory methods? i added a bat file to my app resource and using a lot of methods to call it but it's not working, what i am trying is to do is to program my app to start a .bat file in it's resource with special directory method so that the app can be able to run an any pc without have to search the c drive a path with the bat file location, the app is a keygen.
Thank you.. it help me so much .. thanks again
how the file properties were given?
I am getting an error :-
Error 1The name 'FileOpen' does not exist in the current context
Error 2 The name 'FileOpen' does not exist in the current context
I've created the ''hello.txt'' but i cannot find it on my computer .Why ?
+Shania Sooranna If you created the file in VB.NET with just the filename "hello.txt" then it should be inside your Debug folder, which you'll find "Project Folder\bin\Debug"
Hi NIck, that's a very interesting tutorial, it's really very helpful to me, but please i need to know how do i read only a specific number of items (say 120 items) from CSV file that has almost 800 items? Regards
Hey, would it be possible to email you something that i am trying to make with vb? its been awhile since i used it and i do need some help
Sure thing, send away
How would I add text to a specific line, without deleting whats on line 2
ePlays yes how :C
+ePlays Openmode.append
you are awesome , i never understood vb from my teachers but you :* . thanks for it . how do we close file to save it ?
+Adnan Shah Glad I could help
i ahve a textbox where i write in a word. Lets say a write Hello in it.
When i press the button i want the programm to check if the word hello
is in the textfile. I have multiple words in the textfile. i ahve
"hello" "bye" and "one" in it. How can i let the programm search for a
match? btw the textfile is on dropbox
This is a massive question really. You can use a function called IO.File.ReadAllLines("myfile.txt") which will pull all lines from a text file into a Array of Strings. You can then loop through the array and check if the words you need are in it. If you mean that you want to download the file from Dropbox prior to opening it you need to look at WebClient.DownloadFile("myfile.txt")
Array, do a linear search. Hopefully it works
can you please show me how to connect access database to a console app in vb.net please please
is it necessary to add ToUpper with input? what does it do?
I'll admit it's been a long while since I made this video and I forget where I used the ToUpper function. But ToUpper is good to convert characters in a string into all uppercase letters. Then it's easy to compare strings using if statements.
Nicholas Dingle ok great thanks
Thanks for the tutorial!
I do have a small question... Which option do I have to select in the program to also get this 'suggestion/explanation message boxes' you get at for example 4.57
When the parameter suggestion box comes up you can press the up and down arrow on the keyboard to see the options.
Thank you for your reply, but it is actually this parameter suggestion box that I am curious about. when I write code is doesn't 'come up'.
Do you know whether this is something you can turn on and off?
+Frank van Dongen is this the problem? omegacoder.com/?p=1008
Yes I think you're right. Maybe I've got a 'limited license' or something because I can't choose the first 4 options in Edit/Intellisense
+Frank van Dongen odd. Have you got the community version? Also what version number are you running?
I've followed all the steps in your video :/ and there's no hello.txt which has been created
hey nicholas, i have a two solution project. in solution two, i have classes and module that i want to used in solution one
but the two project is not linking. when i am in solution two all the class and modules show up in the toolbox but in solution one it's not. what do you think i am missing out?
I'll assume you have two projects in one solution and that project two contains code for project one. You need to open My Project for project one and go to references. Add project two in there. After that down the bottom, tick the name of project two and you're good to go
here is the project mega.nz/#!1gdDAbob
Link says I need a decryption key
+Nicholas Dingle here's my new link:
drive.google.com/open?id=0B-K3TTJgHgWXbmxSbEVDYk1FUGc
just right click and download the NHunspell project
hey friend, did get the project?
hello nicholas.my name is khairi and im from malaysia. i would like to ask you on how to make a vb program. there are 1000line of data in notepad. then user want to devide the 1000 line into whatever number their like using vb
hope u can help me
Hi mate do you want to email me your idea with a bit more detail? I'd love to help out, right now I'm not quite sure what you would like to do.
hi mate. I already pm you at hangout
do still using hangout?
Khairi Salleh Not really. Do you want to email me an example text file you might be using in your application?
I think VB.Net closes open files when you end the program, if you had left it running you would have got an error.
what does .toUpper does
thank you, good and easy to understand
Thank you so much Sir!! Your video has been extremely helpful!!
and yes..MOOOOOOOOOOOOOOO!!! coz why not!
Thank you so much
Hello there Sir, I was wondering if you could help me out with accessing the binary files in random mode, i already know the method to access the file using Stream method but i am not able to do it by FileOpen method.. BTW.. You Rock..
You can't actually use FileOpen and Stream at the same time. They are different generations of technology. I'm almost certain that under the hood, FileOpen would be using Streams.
Depending on what you want to do I would go down the Stream method or using the File.ReadAllText methods. Hope I helped you there.
Thanks for your quick reply.. I just want to put data into file and use Hash function to calculate the record starting position.. and read from the same position..e.g
file.position = hash(thisfile.name)
i amm not familier with ReadAllText method.. can you suggest any good book for console programming?
Thank you very much!
thank you for this interesting tutorial...:)
hey there. Love your videos and thanks a lot.Can you make a video for random files? That would be so good of you.
I might end up doing this for C# but VB won't really get much attention from me in the future.
thank you for your response..
Great video but Windows defender is SO stupid and it blocked my program from creating the file :(
I called my extension a ds file (for my programming language DylanScript :D)
excellent
Ty a lot !
nice tut
thanks bro
Console.WriteLine("ALL HAIL NICHOLAS DINGLE!! OUR SAVIOUR!!")
Dude, you're funny :)
thank
Numba
Sorry but didn’t find this helpful
love this video. please marry me
Hi NIck, that's a very interesting tutorial, it's really very helpful to me, but please i need to know how do i read only a specific number of items (say 120 items) from CSV file that has almost 800 items? Regards