473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

XML Document Object woes

Hello all,

After deploying a project onto our network drive, I've run into a snag
with the .NET security policies. I realize I can use the .NET
configuration snapin to change the Machine level code groups, but doing
this on each machine would be a nightmare due to the number of
computers using this program. I've been experimenting with code to edit
the XML file that holds the security settings, but this is where the
problem lies. Using XMLDoc.save adds indentation to the xml file and
puts all the attributes for a node onto the same line. From what I can
tell this prevents both the application and the configuration tool from
accessing the file. (Actually, the configuration tool will undo/restore
any changes you have made when it opens). Any ideas you gurus can offer
I appreciate.

Sub Main()
Dim XMLDoc As New XmlDocument
Dim XMLNode As XmlNode

XMLDoc.Load("C:\WINDOWS\Microsoft.NET\Framework\v2 .0.50727\CONFIG\security.config")
For Each XMLNode In XMLDoc.GetElementsByTagName("CodeGroup")
If XMLNode.Attributes("Name").Value = "LocalIntranet_Zone" Then
XMLNode.Attributes("PermissionSetName").Value = "FullTrust"

XMLDoc.Save("C:\WINDOWS\Microsoft.NET\Framework\v2 .0.50727\CONFIG\security.config")
Exit For
End If
Next
End Sub

Thanks,

Seth

Sep 7 '06 #1
1 888
I found a usable solution - it seems I was overthinking the problem as
the .NET security policy wouldn't allow the below code to run any way.
It looks like I'll just have to just run a login script that executes
the Deployment Package that I created with the .NET configuration
wizard in order to change the Machine Level settings.

Thanks all,

Seth Rowe
rowe_newsgroups wrote:
Hello all,

After deploying a project onto our network drive, I've run into a snag
with the .NET security policies. I realize I can use the .NET
configuration snapin to change the Machine level code groups, but doing
this on each machine would be a nightmare due to the number of
computers using this program. I've been experimenting with code to edit
the XML file that holds the security settings, but this is where the
problem lies. Using XMLDoc.save adds indentation to the xml file and
puts all the attributes for a node onto the same line. From what I can
tell this prevents both the application and the configuration tool from
accessing the file. (Actually, the configuration tool will undo/restore
any changes you have made when it opens). Any ideas you gurus can offer
I appreciate.

Sub Main()
Dim XMLDoc As New XmlDocument
Dim XMLNode As XmlNode

XMLDoc.Load("C:\WINDOWS\Microsoft.NET\Framework\v2 .0.50727\CONFIG\security.config")
For Each XMLNode In XMLDoc.GetElementsByTagName("CodeGroup")
If XMLNode.Attributes("Name").Value = "LocalIntranet_Zone" Then
XMLNode.Attributes("PermissionSetName").Value = "FullTrust"

XMLDoc.Save("C:\WINDOWS\Microsoft.NET\Framework\v2 .0.50727\CONFIG\security.config")
Exit For
End If
Next
End Sub

Thanks,

Seth
Sep 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Mark | last post by:
O, woe is me, to have seen what I have seen, see what I see! (That's Shakespeare for those who were wondering what I'm on about) I am "having fun" with cookies. And I wonder if I have...
0
by: Cedric | last post by:
This is a 3 weeks old problem, but having found a solution (and having looked for one here, finding only this message), I'm replying now. From: Jive (someone@microsoft.com) Subject: Upgrade...
3
by: Angel Cat | last post by:
Trying to get my jobs to send mail when job fails. Should be easy but it's giving me headache Had a whole slew of issues. Outlook is installed with a n outlook mail profile set up that can...
6
by: David List | last post by:
I'm having a problem using different properties of the document object in the example javascripts in my textbook with browsers that identify themselves as using the Mozilla engine. One example of...
2
by: Aaron | last post by:
Hi, I've seen javascript code where a constructor function is passed an argument "document", and inside the function itself the assignment "this.document = document;" is made. This is the code...
4
by: Wow | last post by:
when calling a object in an html, should I use self.objectname this.objectname or document.objectname? for example, i have a form called theform and a link called thelink i can call...
12
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical...
1
by: SQwilDude | last post by:
My ASP2.0 application has always run fine in IE6 and FF. Only on IE7 installations I get a 'document.form1' is null error after a postback that creates an .m3u file on the server and does a...
139
by: Joe Mayo | last post by:
I think I become more and more alone... Everybody tells me that C++ is better, because once a project becomes very large, I should be happy that it has been written in C++ and not C. I'm the only...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.