In travel, a visa is a document which allows you to go to particular places; it is used when simply having a passport is not enough, when you need documents approved based on the passport. It usually is only good for a specified period of time.
This is much like the Passport credentials you get when logging into Microsoft's chat rooms. We will refer to the
VISA PROPERTIES
a 'visa' has several properties associated with it, attributes which fully describe it for our purposes. Here are the core ones I have s0 farbr] + Owner This is the Passport account which owns the Passport used to get this 'visa'; it is something in the form of username@mydomain.com. This is not strictly a part of the visa itself,and may not be needed for some purposes.
+ Nick This is the "real" nickname of the account. It is not strictly necessary, but may be needed for the
+ Ticket This is MSPAuth in a browser cookie, or PassportTicket in a chat control.
+ Profile This is the long string value of MSPProf in a browser cookie, or PassportProfile in a chat control. DO NOT confuse this with the MSNProfile!
+ MSNRegCookie This is the long string value of MSNChatNN in a browser cookie, or MSNRegCookie in a chat control.
+ ProfileType This is MSNProfile in a chat control. It is a number which controls the type of icon you get on entry to a room.
+Timestamp This is a ctime value indicating when the Passport was acquired.
VISA POPULATION METHODS
Handling a visa can be done a few ways. Ideally it should be possible to get them from various sources quickly and easily; unfortunately, it is not. This class also tries to clean up some of those methods.
This is really an issue with translating information in various files and formats from and to each other. You may have visa data stored in a Vincula passport.dat file, in an IRCDominator file, or may be trying to read it from a browser cookie. These methods are designed to read and write automatically so visas can be shared.
+ FromBrowserCookie(Byval cookie as string) Populates the visa from a browser cookie string. The string 'cookie' is the value of an IE instance's document.cookie property. Limitations: will not be able to read ProfileType or Owner. MSPAuth, MSPProf, MSNChatNN are parsed from a browser cookie; we assume that the cookie is fresh, so the Timestamp is calculated now.
+ FromVinculaFile(Byval filepath as string, optional byval nick as string) Populates the visa from a Vincula vpassport.dat file. The string 'filepath' is the path to the vpassport.dat file; nick is the name of a section or a nick string in the section. If nickname has been specified already, it does not need to be supplied here. We read cookie, ticket, profile, showprof, updated; none need to be translated.
+ VinculaNickList(Byval filepath as string) [returns an array of strings] Returns an array of section names from a Vincula vpassport.dat file. The string 'filepath' is the path to the vpassport.dat file.
+ FromIRCDomFile(Byval filepath as string) Populates the visa from an IRCDominator .dat file. The string 'filepath' is the path to the IRCDominator.dat file. We read the [Passport] section of the dat file and then parse it. PassportProfile, PassportTicket, Cookie, Email, LastUpdate are used to populate our visa. The one missing piece here is the ProfileType; Timestamp is actually converted to a ctime string. The
+ FromWWRegistry(optional byval owner as string) Populates the visa from HKCU\Software\Watercooled Software\ChatCredentials\%Owner%. If Owner has been specified already, it does not need to be supplied here.
+ FromEyeDropperFile()
+ FromViperFile()
+ FromHtmlParameters(byval htmlpath as string) Reads an html file and finds data from the parameter strings.
better late then never, but is a perfect example of how to use SHDocVw and document cookie, and the tecnique still works, so it can be usefull for others that want to make grabbers.