Post: A little help with my VB programming? :) (save/edit issues)
01-25-2011, 08:44 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Hello all Smile
thought i'd have a stab at visual basic and have came up with a text editor but need a bit of help..
I'd like it to only be able to certain lines of a text file as a optinal if anyone can come up with a answer that would be great Smile
and i'd like it to only be able save the file with a maximum size of 1mb.
much thanks to anyone that can solve my small..hurdles Smile and thanks to anyone that attempts to help Smile
01-28-2011, 09:47 PM #2
There are plenty of tutorials on youtube about creating your own text editor/notepad. Things like limiting size would be limiting character count. Every character takes up the same space. Figure out how much space each one takes and limit it to that. I know I'm giving you alot of information but the fact of the matter is I don't feel like explaining something that's easily found on the net via search.

The following user thanked TimeShin for this useful post:

xshadowedx
01-28-2011, 10:27 PM #3
Default Avatar
Oneup
Guest
Each character takes up 1 byte, but honestly there are easier ways then that.

For instance you could use this to get you started:

    
Imports System.IO
Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim checkThisFile As New FileInfo("C:\Users\1UP\Documents\test.txt")
Dim getFilesize As Long = checkThisFile.Length
Me.Text = getFilesize.ToString
End Sub
End Class

This will return 56 since the file size is 56bytes.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo