dcahrakos Posted August 3, 2004 Posted August 3, 2004 how do I do Put, and Get commands in Vb.net....is it the same as in vb6? or what? Quote
Administrators PlausiblyDamp Posted August 3, 2004 Administrators Posted August 3, 2004 Although the functions still exist you really should use the newer .Net methods. Look at the classes un System.IO for a starting point and also search MSDN for serialization. If you have a particular problem / question post the relevant code etc and we'll see what we can do. You may find http://www.xtremedotnettalk.com/showthread.php?t=39585 useful as well. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
dcahrakos Posted August 3, 2004 Author Posted August 3, 2004 no questions really, except what are the new functions that replace put, get, etc? Quote
Arch4ngel Posted August 3, 2004 Posted August 3, 2004 For property... look at this link http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfpropertiespg.asp Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
dcahrakos Posted August 5, 2004 Author Posted August 5, 2004 that doesnt help at all....I cant find anything on the new functions that replaced Get and Put in vb6... Quote
Arch4ngel Posted August 5, 2004 Posted August 5, 2004 Sorry... I gived you the C# reference (my fault) This link will explain you how to do a transition between VB6 and VB.NET : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvbpj01/html/gs0601.asp Here is an exemple of a Integer Property : [size=2][color=#0000ff]Public[/color][/size][size=2][color=#0000ff]Property[/color][/size][size=2] Test() [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]Integer[/color][/size] [size=2][color=#0000ff]Get[/color][/size] [color=#0000ff]'..... something here to retrieve the value[/color] [size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Get[/color][/size] [size=2][color=#0000ff]Set[/color][/size][size=2]([/size][size=2][color=#0000ff]ByVal[/color][/size][size=2] Value [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]Integer[/color][/size][size=2])[/size] '..... Something here to set the value received [size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Set[/color][/size] [size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Property[/color][/size] .... As an addition I'm working with C# and there's a wizard to build property, method, field, indexor... I must admit that VS.NET is lacking "user-friendly" tool for VB.NET user (which should be a big majority of all .NET programmer) Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
dcahrakos Posted August 5, 2004 Author Posted August 5, 2004 thats better, Thanks, but how would that work with getting a hex value, i know in vb6 it was: Get #1, &H4DA + 1, variable and i used put like this Put #1, &H4DA + 1, CInt(Val(variable)) and they worked fine...but I dont see how it would work with the way you showed me in your post... what im trying to do is make a program that edits a certain thing, so you can change values, and text in the program....I know how todo everything, except the get and put stuff... Thanks in advance Quote
Administrators PlausiblyDamp Posted August 5, 2004 Administrators Posted August 5, 2004 If you are wanting to read and write to files then you would use something like: Dim fs As New System.IO.FileStream("c:\test.txt", IO.FileMode.Open) Dim b As Byte b = fs.ReadByte() ' to read a single byte Dim data() As Byte fs.Read(data, 0, 100) 'read 100 bytes. fs.Write(data, 0, 100) 'write an array of 100 bytes fs.WriteByte(1) 'write a single byte although you may want to look at serialization if you are saving things to your own file format - takes a lot of the work out of it. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
dcahrakos Posted August 6, 2004 Author Posted August 6, 2004 excellent, exactly what I wanted....naw, I dont need serialization, im saving changes to the file that already exists....thanks Quote
Joe Mamma Posted August 6, 2004 Posted August 6, 2004 aren't 'StreamReader' and 'BinaryReader' the suggested method for interfacing streams???? It's an adapter that makes it simple to get data between streams and data structures. You never have to interface the stream. look up 'writing binary data' and 'Writing Text to a File' in the Help Index Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
dcahrakos Posted August 8, 2004 Author Posted August 8, 2004 well really its not binary im looking for its always Hex.... Quote
Joe Mamma Posted August 8, 2004 Posted August 8, 2004 well really its not binary im looking for its always Hex.... Everything is binary. You want binary reader for everything that isn't to be interpreted as Text. Hex is just a manner of representing an integer - a binary piece of data. I could represent it as Oct, its still a binary piece of data. Use the BinaryReader. Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.