borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

(Pages: Next Page 1 2 ) Print This Topic
Previous Topic (I Need faster pixel graphics)Next Topic (How to set your form semi-transparent) New Topic New Poll Post Reply
AndreaVB Forum : VB General : How can i know the header of a file
Poster Message
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92

icon How can i know the header of a file

hiyaa....
guys can pleaseeeeeeeee anyone help me ??

How can i know the Header of any files ??
Can i store some Strings in those Headers ?? If yes ...How ??
Pleaseeeeeeeeeeeeeeeee helpp meeeeee......

05-03-2003 at 06:29 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: How can i know the header of a file

What do you mean by the header of a file?


____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

11-03-2003 at 09:44 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92
icon Re: How can i know the header of a file

hiya JLRodgers.....
             thanx ....you are back  

i hope u will help me out .....
by header i mean ....(.exe,.txt...etc) i mean the header of any file ??



____________________________
FireFox - Its Yours & Its Free
Here it is

45 Gmail Invities left ;) ....PM me to get one...

13-03-2003 at 03:49 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: How can i know the header of a file

Still confused.

Do you mean you want to retrieve the extension of a file, the filename, info contained in the file, what type of file it is (ie: associations in the registry), or change a filename?

Except for changing filenames, putting strings into any of these would, potentially, corrupt the file, or make the file unopenable.

Reason being is a text file could be empty with only filename.txt existing so there aren't headers in them, just filenames/extensions. Modifying anything in an exe could easilly make the program not work.

____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

13-03-2003 at 07:07 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92
icon Re: How can i know the header of a file

Oh....JLRodgers....
     i am onto a project for my college i have to make a p/w protection utility that can save any files....for that i need to store the p/w somewhere.....i dont want to create any database......and i thought it would be better storing it in the file header.......

If u say .exe files cannot be done so ...then how are .exe files password protected ?? without any kind of database....i had a hand of 1 such which uses MSVBVM60.DLL .....does it mean that this dll consist of some functions or something to carry out the job ??

since u opened my eyes ....can u suggest me with something ?? that i can do to p/w protect files ??

____________________________
FireFox - Its Yours & Its Free
Here it is

45 Gmail Invities left ;) ....PM me to get one...

15-03-2003 at 04:47 PM
View Profile Send Email to User Show All Posts | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: How can i know the header of a file

hi. i just wanna butt into yer discussion here...

hope you guys don't mind.

siddhs... what do you mean by password protecting a file?

there are ways to protect your vb exe, but for other files?

do you think you could give an example... or a scenario even..

all i can think of is that your asking how to put a password in any file... which can be done, i think... but it's kind of dangerous...

yo'd have to use some method of encryption.


but anyway... hope you could give a scenario on this issue.

i'd also like to try and help you.

____________________________
Been busy trying to take a second degree <--it's not working out...

15-03-2003 at 06:37 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: How can i know the header of a file

I really don't know exactly how they password protect files. But I believe it encrypts the file, using the password in part of the encryption so it can't be unencrypted without it (at least not properly). Then it has a mini program that unencrypts the file that's added to the file (basically has the file inside another) and saved as the original file.

Can't be sure, but a utility that I saw years ago almost tripled the file size when it password protected it, and when you double-clicked it, it prompted for a password, so it seems logical.


As far as how to do it, I have no idea.

____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

15-03-2003 at 06:56 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92
icon Re: How can i know the header of a file

thanx JLRodgers and vbgen......

Guys...what i mean here is that .....
eg: i got a file abc.txt now i want to p/w protect it ....it means that whenever u click on that file it would ask for a p/w from u and until u give the correct p/w it wont allow u to access it.....and i want to apply it to all the files....i mean any damn file in the system......so that everytime u access the p/w protected file it would ask for a password from u and until u dont give the correct p/w ACCESS IS DENIED !

ya JLRodgers ...u are right .....i had seen one of those u mentioned the utilities which saves a .exe file with a password......ya and when  i went through for the size of the file it was doubled then usual .....and it was coz it was encrypted....morever i think when they ask for p/w in such utilities its basically that they are just asking for a Decryption KEY ....and they name it as p/w ...dont u think so ??

morever any suggestions to BOOST my confidence...please guys i need Help !  

____________________________
FireFox - Its Yours & Its Free
Here it is

45 Gmail Invities left ;) ....PM me to get one...

17-03-2003 at 11:46 AM
View Profile Send Email to User Show All Posts | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: How can i know the header of a file

here's a catchy one, siddhs.

access each and every filetpe in your system, then change the defalut program that runs it with your own program(one which will ask for a password) then when the password is correctly filled, run the original program with the file.

got it?  

____________________________
Been busy trying to take a second degree <--it's not working out...

17-03-2003 at 03:26 PM
View Profile Send Email to User Show All Posts | Quote Reply
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92
icon Re: How can i know the header of a file

Thanx vbgen....
           I didnt get one thing of urs....abt....
"access each and every filetpe in your system, then change the defalut program that runs it" .....now how can i know which file type is associated with which program and which is the default prg that runs it  

can u help me plz ?!

____________________________
FireFox - Its Yours & Its Free
Here it is

45 Gmail Invities left ;) ....PM me to get one...

17-03-2003 at 07:15 PM
View Profile Send Email to User Show All Posts | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: How can i know the header of a file

if you are using windows 98 second edition...

go to the folder options at the settings menu of the start button.

then, go to the filetypes tab.

you'll see there a list of all registered file types and extensions.

if you study one of them, you'll see that there is a default progrm that can open them.

what you have to do is to take note of the default program use for each of these file types. e.g .txt, .doc, .asp etc...

and substitute it with your program(the one that'll ask for a password before going through)

remember the file type... so that when a password has been given(correct pw) then use shell to run that file with its original program.

got it now?  

____________________________
Been busy trying to take a second degree <--it's not working out...

18-03-2003 at 01:28 AM
View Profile Send Email to User Show All Posts | Quote Reply
win_dir
Level: VB Guru

Registered: 04-08-2002
Posts: 390
icon Re: How can i know the header of a file

Or, if it is feasable to disable you system temporarily you can get your program, when it starts, to disable the taskbar, desktop and CTRL+ALT+DEL menu so there is only your program available so that they HAVE to put in the password. And addition to this idea and VBgens would be to save all of the filenames and paths your program has to protect. Then see if there is an API that lets you know when a document/executable is being launched (and its name) on the system and some way of allowing it or denying it through the API. You got me? if you need me to re-word this or something just say so.

It may be a little easier for us all here if you specified exactly what the project is that you are working on.

[Edited by win_dir on 18-03-2003 at 09:38 PM GMT]

____________________________
We have a Mustek 5 M/Pix GSm@rt USB Digital Camera
for just £74.03 , offer only on until 30th February!

<AllDuck.com>      

Enquiries/Sales: 0845 430 9862
Fax: 0870 950 4532

18-03-2003 at 09:31 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92
icon Re: How can i know the header of a file

thanx vbgen and win_dir....
  firstly, vbgen u saying that i should change the default prg used to open the filename....ok abt that default program thing its a good idea......so suppose it.....eg: i got a file with extension .txt now i want to p/w protect it.......so now i have to change its default program i.e. notepad.exe to my program right........

But, for this i need to change the extension of the file ??  will it not corrupt the file ??

No, win_dir i couldnt get what u saying .....abt the alt_cntrl+del  option....

well, what i m working on is my college project....like we have to undergo a 2 months project work......so decided to make this p/w protection utility ....which can p/w protect anyy file in the system.....once p/w protected u need to give the p/w and then only u can access that particular file.....

so .....

____________________________
FireFox - Its Yours & Its Free
Here it is

45 Gmail Invities left ;) ....PM me to get one...

19-03-2003 at 02:54 AM
View Profile Send Email to User Show All Posts | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: How can i know the header of a file

i think what win_dir is trying to say is that you ought to try and disable the user's access to almost any resource on his terminal, apart from trying to ncrypt files.

you will not need to change the extension of the files, siddhs...

just change the program that by default opens the file.

yes, change notepad.exe with your program, then when the password is right, launch notepad.

i'll see if i can try this as well, okay?  

____________________________
Been busy trying to take a second degree <--it's not working out...

19-03-2003 at 03:33 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: How can i know the header of a file

Just as a quick cautionary thing, you may want to be wary of changing EXE, DLL open with program. If the program's not found, crashes, or has errors, the system will go down, and may not start back up. Not sure if you were planning on it, but just in case (actual privacy lock down tools that do this can mess up computers, and they've been done by large companies).

____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

19-03-2003 at 06:44 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
win_dir
Level: VB Guru

Registered: 04-08-2002
Posts: 390
icon Re: How can i know the header of a file

vbgen has summerised my post correctly.

BTW. JL, is it actually possible to change what runs EXE's?

[Edited by win_dir on 19-03-2003 at 08:52 PM GMT]

____________________________
We have a Mustek 5 M/Pix GSm@rt USB Digital Camera
for just £74.03 , offer only on until 30th February!

<AllDuck.com>      

Enquiries/Sales: 0845 430 9862
Fax: 0870 950 4532

19-03-2003 at 08:16 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: How can i know the header of a file

Thought there was... But I just looked and didn't see it listed, of course last time I checked was quite a while ago. There was something listed somewhere that said how to write a VB program to track all programs that were run. I was thinking one example told how to re-direct it.

____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

19-03-2003 at 09:20 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
win_dir
Level: VB Guru

Registered: 04-08-2002
Posts: 390
icon Re: How can i know the header of a file

I would've thought there were a few API calls to control the launching of Exec files or maybe all file types but i haven't had a look because i've never had any need.

What may be useful to siddhs is if he were to look at the API calls in the file section in "API-Guide" which you can download from all-api.net (dont forget to press the update button once inside the program). I saw a few calls like closing open files and finding the files by handles etc. which could give him a few ideas, it includes examples of how to use the functions under the examples tab. Good luck!

[Edited by win_dir on 19-03-2003 at 09:49 PM GMT]

____________________________
We have a Mustek 5 M/Pix GSm@rt USB Digital Camera
for just £74.03 , offer only on until 30th February!

<AllDuck.com>      

Enquiries/Sales: 0845 430 9862
Fax: 0870 950 4532

19-03-2003 at 09:48 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92
icon Re: How can i know the header of a file

thanx everyone....vb_gen JLRodgers win_dir ....thanx a lot...

well, the idea abt changing the default prg. is a good one...today i will try to do it .......lets see if i m successful....one more thing .....what i tried out was ...

i had a file abc.txt....i renamed that file to abc.txt.tss......some unknown extension .......that means now windows wont recognise that file right and the contents would be lost right.....now again what i did was i renamed it back to abc.txt......and all the contents of abc.txt were back !! .....well, i dont know abt all u Experts ....but me came to know abt this for the first time ........

so....any new ideas tips tricks ....please post for me ....


____________________________
FireFox - Its Yours & Its Free
Here it is

45 Gmail Invities left ;) ....PM me to get one...

20-03-2003 at 06:22 AM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: How can i know the header of a file

Well, if you renamed the extension, it wouldn't appear to be readable, but if you keep the .txt in the name, it's pretty obvious as to what type of file it is or was.

It doesn't take much to open the file in notepad even if the extension's different.

____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

21-03-2003 at 07:15 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92
icon Re: How can i know the header of a file

Guys, i did download that api viewer from allapi.net....

But, since there are soooo many functions and constants and all stuff.....how will i know which is the one i want ??

any particulars from u ??



____________________________
FireFox - Its Yours & Its Free
Here it is

45 Gmail Invities left ;) ....PM me to get one...

21-03-2003 at 12:56 PM
View Profile Send Email to User Show All Posts | Quote Reply
win_dir
Level: VB Guru

Registered: 04-08-2002
Posts: 390
icon Re: How can i know the header of a file

As sent in an email to siddhs:

If you look at the description and examples of each APi call it will tell you what it can do. The API calls are also organised into categories like "Mouse", "Keyboard", "File" etc. you can change to the categorised view by pressing the category tab at the top of the list. If you have any other problems please contact me.

____________________________
We have a Mustek 5 M/Pix GSm@rt USB Digital Camera
for just £74.03 , offer only on until 30th February!

<AllDuck.com>      

Enquiries/Sales: 0845 430 9862
Fax: 0870 950 4532

21-03-2003 at 04:51 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: How can i know the header of a file

Just so others know too, there is a search function in the API viewer from AllApi.net, numerous fields can be searched, so it's pretty easy to find stuff (normally).

____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

21-03-2003 at 08:02 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92
icon Re: How can i know the header of a file

Guys.....well, that Allapi.net thing is going on ....

But, a question : Can i open a file(anyfile) using VB ??

if yes is it with the help of API ??

____________________________
FireFox - Its Yours & Its Free
Here it is

45 Gmail Invities left ;) ....PM me to get one...

22-03-2003 at 11:56 AM
View Profile Send Email to User Show All Posts | Quote Reply
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92
icon Re: How can i know the header of a file

Hiya Guys.....
     about the question i asked u all abt opening the file....

i found something like this .....
Public Declare Function
ShellExecute Lib
Guys, i found this thing.....what do u say abt this ??

-->ShellExecuteEx
-->ShellExecute

are this same ?? which is better/suits my application ??

where are u all ?? please reply !?

[Edited by siddhs on 22-03-2003 at 05:47 PM GMT]

____________________________
FireFox - Its Yours & Its Free
Here it is

45 Gmail Invities left ;) ....PM me to get one...

22-03-2003 at 12:25 PM
View Profile Send Email to User Show All Posts | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: How can i know the header of a file

They do the same thing, just different ways to pass the info to them. There's code on the board somewhere if you need it.

They just open the file with the program's that's associated with it (in the registry).

____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

22-03-2003 at 08:30 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92
icon Re: How can i know the header of a file

where is that code JLRodgers ??



____________________________
FireFox - Its Yours & Its Free
Here it is

45 Gmail Invities left ;) ....PM me to get one...

22-03-2003 at 08:52 PM
View Profile Send Email to User Show All Posts | Quote Reply
win_dir
Level: VB Guru

Registered: 04-08-2002
Posts: 390
icon Re: How can i know the header of a file

if siddhs just wants to launch any app or file i think he can just do:

Shell("C:pathtofilefile.exe")


there are some other parameters but i forgot what they are, (i am away from my machine), the other parameters will show when you start to type the command (AutoComplete).

____________________________
We have a Mustek 5 M/Pix GSm@rt USB Digital Camera
for just £74.03 , offer only on until 30th February!

<AllDuck.com>      

Enquiries/Sales: 0845 430 9862
Fax: 0870 950 4532

22-03-2003 at 09:11 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: How can i know the header of a file

http://www.andreavb.com/forum/viewtopic.php?TopicID=342&page=0#844

http://www.andreavb.com/forum/viewtopic.php?TopicID=856


____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

22-03-2003 at 09:20 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
siddhs
Level: Professor

Registered: 02-03-2003
Posts: 92
icon Re: How can i know the header of a file

Thank You ...JLRodgers And win_dir...

I will try it out and let u know !  

____________________________
FireFox - Its Yours & Its Free
Here it is

45 Gmail Invities left ;) ....PM me to get one...

24-03-2003 at 05:22 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : How can i know the header of a file
Previous Topic (I Need faster pixel graphics)Next Topic (How to set your form semi-transparent) New Topic New Poll Post Reply
(Pages: Next Page 1 2 )
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder