Vb.net need help with reading text file

Toshiba Satellite l505d-s5965 notebook
April 16, 2017 at 16:31:42
Specs: Windows 7, 1024
I need help figuring out how to detect if user selected a text file to read or has selected highlighted text.

In vb.net I know how to do both but not how to do both and be able to detect what the user has done yet.

I found this class that was wrote by someone that maybe could help


What are your thoughts?

Thank you 😊

See More: Vb.net need help with reading text file

Reply ↓  Report •

April 19, 2017 at 06:39:53
Firstly what is the purpose of this? I ask because if we can understand the need then we can try to provide a solution.

I have written something similar to this many years ago in vb6 which should be easy to translate to vb.net. What I wrote was a keylogger.


it would log the files names of opened documents, select or copied text etc.

Now although this is something we will NOT help with, the concept is pretty similar I guess but again

it depends on
what you are trying to achieve?
what would trigger an event - does the software need to continuously 'watch' for user action? or would a mouse event or keyboard event trigger logging?

Reply ↓  Report •

April 19, 2017 at 07:07:07

My goal is when the user selects text or selects a file using a keyboard shortcut of some type have the program read the file or text the encrypt the text or file so it can't be read.

This is just a hobby project for personal use.

Thank you

Reply ↓  Report •

April 19, 2017 at 07:23:01
So the code would need to

Check the type of file selected or opened?
Determine if its a file rather than a folder
Encrypt the text within the file so that it is unreadable?
Or encrypt the file itself so that it cannot be opened?

Interesting project, it is doable but a lot of work how far have you gotten with this?

Reply ↓  Report •

Related Solutions

April 19, 2017 at 07:54:14
So far I haven't started just getting ideas around.
I'm thinking either encrypting the file from being opened or encrypting the text inside.

But your right I would need to check file types and also determine if it's a file selected or a folder.

Reply ↓  Report •

April 19, 2017 at 20:38:45
No way to know, from clipboard content, what the user intends. This will have to be "interactive" or driven from commandline params.
The encryption method must be accommodated for either appending-to or creating the target file, and safeguard if over-writing an existing target-file.
Since you're in early stages, these are my only contribution. I don't know your encryption method, so I can't anticipate it's requirements.
I would assume any clipboard text is meant to be encrypted and filed.

message edited by nbrane

Reply ↓  Report •

Ask Question