I have written a program that uses a com port to retrieve values from a machine to record into a database. In order to do this I have two XML files that store parameters. After installation it comes with an error that it cannot find these files. Using VB2005 Express I need to publish the program. The two questions I have are:
1.During install of my program it does not ask where I want the program installed. Can I setup the install that it loads into a certain directory? It seems to automatically send it to a folder like this ( C:\Documents and Settings\wlaflamme\Local Settings\Apps\2.0\0EMGZLYD.1OB\L6YMWJP7.W6Q\insi..tion_41fa2b4b042777a5_000c.0011_49a58c74fa82290a\ISMinitial.xml')
2. What is the best recommendation for retrieving data from files? What is the best way to include these files in the publish option? Here is generally how I retrieve the XML file.
Dim style_count, last_count, i As Integer
'StreamReader will retrieve the file from source and will convert to a stream to be processed
Dim sr As New System.IO.StreamReader("ISMinitial.xml")
'The XmlTextReader
Dim xr As New System.Xml.XmlTextReader(sr)
'The XmlDocument
Dim initialDoc As New System.Xml.XmlDocument
initialDoc.Load(xr)
Dim initialItem As System.Xml.XmlNodeList = initialDoc.SelectNodes("initial/variable")
Dim xml_gender As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("gender")
Dim xml_style As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("style")
Dim xml_style_count As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("style_count")
Dim xml_width As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("width")
Dim xml_length As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("length")
Dim xml_last As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("last")
Dim xml_last_count As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("last_count")
Dim xml_cylinder As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("cylinder")
Dim xml_delay As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("delay")
Dim xml_sample As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("sample")
Dim xml_interval As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("interval")
Dim xml_com As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("com_port")
Thanks for the help.
1.During install of my program it does not ask where I want the program installed. Can I setup the install that it loads into a certain directory? It seems to automatically send it to a folder like this ( C:\Documents and Settings\wlaflamme\Local Settings\Apps\2.0\0EMGZLYD.1OB\L6YMWJP7.W6Q\insi..tion_41fa2b4b042777a5_000c.0011_49a58c74fa82290a\ISMinitial.xml')
2. What is the best recommendation for retrieving data from files? What is the best way to include these files in the publish option? Here is generally how I retrieve the XML file.
Dim style_count, last_count, i As Integer
'StreamReader will retrieve the file from source and will convert to a stream to be processed
Dim sr As New System.IO.StreamReader("ISMinitial.xml")
'The XmlTextReader
Dim xr As New System.Xml.XmlTextReader(sr)
'The XmlDocument
Dim initialDoc As New System.Xml.XmlDocument
initialDoc.Load(xr)
Dim initialItem As System.Xml.XmlNodeList = initialDoc.SelectNodes("initial/variable")
Dim xml_gender As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("gender")
Dim xml_style As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("style")
Dim xml_style_count As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("style_count")
Dim xml_width As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("width")
Dim xml_length As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("length")
Dim xml_last As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("last")
Dim xml_last_count As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("last_count")
Dim xml_cylinder As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("cylinder")
Dim xml_delay As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("delay")
Dim xml_sample As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("sample")
Dim xml_interval As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("interval")
Dim xml_com As System.Xml.XmlNode = initialItem.Item(0).SelectSingleNode("com_port")
Thanks for the help.