Jump to content
Xtreme .Net Talk

ZeroEffect

Avatar/Signature
  • Posts

    204
  • Joined

  • Last visited

About ZeroEffect

  • Birthday 06/03/1973

Personal Information

  • Occupation
    Audio IT
  • Visual Studio .NET Version
    Visual Basic .NET Standard
  • .NET Preferred Language
    VB.Net

ZeroEffect's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. disregard my question about updating. <facepalm>
  2. You are correct. I got it figured out last night after walking away for a few. Dim doc As New XmlDocument() doc.Load(XMLPath) Dim root As XmlNode = doc.DocumentElement 'Create a new node. Dim elemTicketIndex As XmlElement = doc.CreateElement("TicketIndex") elemTicketIndex.InnerText = "Ticket Index goes Here" 'root.AppendChild(elemTicketIndex) Dim elemStatus As XmlElement = doc.CreateElement("Status") elemStatus.InnerText = strStatus 'root.AppendChild(elemStatus) Dim elemTimeStamp As XmlElement = doc.CreateElement("TimeStamp") elemTimeStamp.InnerText = strNowPlusOne 'root.AppendChild(elemTimeStamp) Dim elem As XmlElement = doc.CreateElement("Ticket") elem.SetAttribute("id", strTicket) elem.AppendChild(elemStatus) elem.AppendChild(elemTimeStamp) 'elem.InnerText = "" root.AppendChild(elem) doc.Save(XMLPath) I have another quick question. How do I update an element? Currently my plan is to delete it and then save it again.
  3. I don't know why I cannot remember how to do this, then again it has been awhile. I am building a XML file I got that down. Now time to added/remove/delete node. Main file looks like this. <?xml version="1.0" encoding="utf-8" standalone="yes"?> <ActiveTickets></ActiveTickets> When a node is added it should look like this. <?xml version="1.0" encoding="utf-8" standalone="yes"?> <ActiveTickets> <ticket> <ticketindex>2345</ticketindex> <ticketstatus>1</ticketstatus> <timestamp>12344567892</timestamp> </ticket> </ActiveTickets> I can get following but I can seem to put it inside the <ticket></ticket> tags. <ticketindex>2345</ticketindex> <ticketstatus>1</ticketstatus> <timestamp>12344567892</timestamp> This is my code. Dim doc As New XmlDocument() doc.Load("ActiveTickets.xml") Dim root As XmlNode = doc.DocumentElement Dim MyNodeTree As Xml.XmlNode 'Create a new node. Dim elem As XmlElement = doc.CreateElement("Ticket") elem.InnerText = "" root.AppendChild(elem) Dim elemTicketIndex As XmlElement = doc.CreateElement("TicketIndex") elemTicketIndex.InnerText = "Ticket Index goes Here" root.AppendChild(elemTicketIndex) Dim elemStatus As XmlElement = doc.CreateElement("Status") elemStatus.InnerText = "Status goes Here" root.AppendChild(elemStatus) Dim elemTimeStamp As XmlElement = doc.CreateElement("TimeStamp") elemTimeStamp.InnerText = "TimeStamp goes Here" root.AppendChild(elemTimeStamp) doc.Save("ActiveTickets.xml") Thank you for helping me remember. ZeroEffect
  4. I have found a solution and another issue now is coming into play. The solution was a RS232 point of sale printer (POS). New issue is, I need to add about 5 CRLF to the end of the print job. The hardware doing sending the data does not have an option for adding them and their interface software lets you send received data to a printer you can format it and it is hard coded to be a standard sheet of paper. I should be able to capture the data and add the CRLF, but how do i send that to a printer. Time to begin more research. ZeroEffect
  5. Do to legal reasons operators need to sign the data that is printed and it needs to be printed automatically.
  6. Soon I will be running into a situation where some equipment i work with will only work with an external serial printer. The problem is I can't use one with thermal paper and track feed is going to be a hard fight and laser would be overkill with a possible four line of text for a single sheet. Solution log all data that would have gone to the printer to a database. While data is also kept in a buffer until a full sheet of paper is use, then print the page an clear the buffer. I just wanted to get some thoughts at this point while I do more research. Thanks, I will post here as I work on this. ZeroEffect
  7. I am told by them that that is how thier application reads and XML file. I have a feeling they are reading/loading the whole file to a string then parsing the data. I'll go at the again about correcting thier application. I have the application that generates the XML they read that XML file. I wish I knew what they were using to read it. Thanks Zeroeffect
  8. I have a situation where a client doesn't want the character escaped. I am using XMLwriter and I can't seem to find a way to stop "&" from becoming "&amp". Is there a way to do this? This is really the onlyl character I need to do this with. Thanks Zeroeffect
  9. So far I have been able to figure out how to read the string from other posts here in the forum. What I am having a problem with is how to read child nodes of the same name. I think I am explaining it right? Here is the string response I have to process. <mmReply command="getStations" userData="hello" status="ok"> <contents> <stations> <station> <id>Station 1</id> <description>Streamline</description> <interface>auto</interface> <status>0</status> </station> <station> <id>Station 2</id> <description>Streamline</description> <interface>auto</interface> <status>0</status> </station> <station> <id>Station 3</id> <description>Streamline</description> <interface>auto</interface> <status>0</status> </station> <station> <id>Station 4</id> <description>Streamline</description> <interface>auto</interface> <status>0</status> </station> </stations> </contents> </mmReply> Using the code below I am only able to return the first <station><id></id></station> data. I don't think I am looping through the nodes correctly. My code Try ListBox1.Items.Clear() Dim objNode As XmlNode Dim objNode1 As XmlNode Dim XMLDoc As New XmlDocument XMLDoc.LoadXml(strXMLData) Dim NodeList As XmlNodeList Dim GetContentsNode As XmlNode Dim XmlStations As XmlNode Dim XmlID As XmlNode GetContentsNode = XMLDoc.SelectSingleNode("mmReply[@command='getStations']") 'NodeList = XMLDoc.SelectNodes("mmReply[@command='getStations']") XmlStations = GetContentsNode.SelectSingleNode("contents/stations") NodeList = GetContentsNode.SelectNodes("contents/stations/station") Dim strNodeElement As String Dim strNodeText As String 'For Each objNode In NodeList For Each objNode In XmlStations XmlID = GetContentsNode.SelectSingleNode("contents/stations/Station") 'XmlID = GetContentsNode.SelectSingleNode("contents/stations/Station") For Each objNode1 In XmlID strNodeElement = objNode1.Name If strNodeElement.ToLower = "id" Then strNodeText = objNode1.InnerText ListBox1.Items.Add(strNodeText) End If Next Next Catch ex As Exception MsgBox(ex.Message) End Try You will see lines i have commented out while tying other things. thanks for your help. ZeroEffect
  10. Found it a DLL was missing from my system32 folder from the dotnet 1.1 framework. ARGH! I'll have to check my setup project to see why it was not included.
  11. Re: Guidence request (update) Ahh time has pasted and my application works, time to deploy. Now new problems. While everything works great on my computer I built the program on I am getting an error message when trying to call these functions from the DLL. unable to load DLL 'genDLL.dll': the specified module could not be found. (Exception from HRESULT: 0x8007007E) What could I be missing? I am researching more online. Thanks For your help. ZeroEffect
  12. The function names still work and there are no compile errors but shouldn't they show up. I am using VS2008. Ok how would I add then as part of a structure? Thansk ZeroEffect
  13. They are public subs. Here is an example of a function I am using to clear data from a structure. Public Sub ClearGenExtra(ByVal gen As GENInfo) gen.gen.extra.Cut = "" gen.gen.extra.Group = "" gen.gen.extra.Length = "" gen.gen.extra.Custom1 = "" gen.gen.extra.Custom2 = "" End Sub Unless I am missing something, I believe I am ;O), they should be showing up. Thanks ZeroEffect
  14. Or am I doing something that can't be done. I have a module with some structures and functions. In my main application i create the class by using Dim a as new b I have access to the structure but the functions do not show up. I can get by but it would be nice if these showed up. Where should I start?
  15. On all accounts my httpwebrequest code is working... I think. The page I used to post to is gone so I can't test my code. It is a long story about why the page is gone. So I am look for the simplest way to test that my application is in fact posting. Is there a site anyone has used to test httpwebrequest posting? Thanks Paul
×
×
  • Create New...