Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Pass IP address

Pass IP address

Scheduled Pinned Locked Moved C#
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Prabhat003
    wrote on last edited by
    #1

    I need to pass the IP address to app.config file that is created after installing the project.I got to add the web reference to run my service. Web reference would be .. http://202.79.41.240/Setup12/Service.asmx. Now I need to change the IP address that gets stored in app.config file. Thanx in advance.

    I 1 Reply Last reply
    0
    • P Prabhat003

      I need to pass the IP address to app.config file that is created after installing the project.I got to add the web reference to run my service. Web reference would be .. http://202.79.41.240/Setup12/Service.asmx. Now I need to change the IP address that gets stored in app.config file. Thanx in advance.

      I Offline
      I Offline
      imsathy
      wrote on last edited by
      #2

      XmlDocument xDoc = new XmlDocument(); xDoc.Load(@"YOURPATH\App.config"); if (xDoc.DocumentElement.SelectSingleNode("appSettings/add").Attributes.GetNamedItem("key").InnerText == "IP") { xDoc.DocumentElement.SelectSingleNode("appSettings/add").Attributes.GetNamedItem("value").InnerText = "genericIP"; xDoc.Save(@"YOURPATH\App.config"); } But I am not sure how safe it is to handle you app config file in dynamically

      Sathy

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups