473,386 Members | 1,821 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,386 software developers and data experts.

Writing a web.config file.. question mark problem

Hi,

I'm trying to write a new web.config file using VB in ASP.net. I am trying to set access permissions, but it won't let me use the question mark to denote: <deny users="?" /> in the authorization tag. Is there an alternative to this or a different encoding I should be using for this character?

My specific error: The '?' character cannot be used here.

Thanks for any replies

Expand|Select|Wrap|Line Numbers
  1.         'Create file, overwrite if exists
  2.         'enc is encoding object required by constructor
  3.         'It is null, so default encoding is used
  4.         Dim objXMLTW As New XmlTextWriter((MapPath(".") & "\basic\" & fold & "\" & "web.config"), Nothing)
  5.         objXMLTW.WriteStartDocument()
  6.         'Top level (Parent element)
  7.         objXMLTW.WriteStartElement("configuration")
  8.  
  9.         'Child elements, from request form
  10.         objXMLTW.WriteStartElement("system.web")
  11.         objXMLTW.WriteStartElement("auhorization")
  12.         objXMLTW.WriteString("deny users="?"")
  13.         objXMLTW.WriteEndElement()
  14.         objXMLTW.WriteEndElement()
  15.         objXMLTW.WriteEndElement() 'End top level element
  16.         objXMLTW.WriteEndDocument() 'End Document
  17.         objXMLTW.Flush() 'Write to file
  18.         objXMLTW.Close()
Jun 16 '10 #1
3 2551
ThatThatGuy
449 Expert 256MB
@penseur11
Wnat's that Question mark, is it really a question mark or some unicode char
Jun 16 '10 #2
In this circumstance, in the xml file, it denotes an anonymous user. Just trying to deny access to anonymous users...but not working when I try to write it into the file.
Jun 16 '10 #3
Frinavale
9,735 Expert Mod 8TB
Look at the output produced...I'm sure that something's invalid that is causing your problem.

-Frinny
Jun 21 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: baylor | last post by:
I'm having a weird bug and wondering if anyone has ever seen this before A Hello World GUI app. Create an app.config. When you build, Studio copies app.config to bin\debug\ and renames it to the...
4
by: UJ | last post by:
Is there a way to write into the .config file? In other words treat it like a .ini file. (I may be confused on what the exact nature of the .config file may be.) I can read from it fine but...
2
by: MK | last post by:
Is there any way to write into the app config at runtime? I want to store position, height and width of my forms.
1
by: Mark | last post by:
I created a windows c# service. This service relies on an app.config file. My installed included the app.config file, but it also generated a file titled my_project.exe.config, which is an exact...
5
by: who be dat? | last post by:
Hello all. I'm writing an application that is writing trace information that can be viewed in trace.axd. I would like to rename this and use a different name specific to my application. I know...
2
by: Mark | last post by:
Our team uses VSS. We each have a user.config file for local settings. One developer's file does NOT kick in - it pulls directly from the web.config file. 1. The user.config file is in the...
1
by: mmitchell | last post by:
I have a VB.Net 2005 solution that uses an installer project to install. When I do an install I would like the app.config/application config file to be installed only when there isn't one...
2
by: Mufasa | last post by:
I know in .Net 1.1 you can't write out to an app.config file but I thought you can in 2.0. Can somebody please post code that will show how to write to the config file? TIA - Jeff.
1
by: neeraj | last post by:
Hi all I have developed desktop application in c#.net. I have installed it on 15 to 20 computers which all are in network. Application having some setting in app.config file. My problem it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.