473,326 Members | 2,102 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,326 software developers and data experts.

single binary

How do I hardcode config properties in my binary?
I would like to put this app.config into my c# source code

<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true"/>
</settings>
</system.net>
</configuration>

Is this possible?
Apr 5 '06 #1
9 1492
Hello, Howard!

H> <configuration>
H> <system.net>
H> <settings>
H> <httpWebRequest useUnsafeHeaderParsing="true"/>
H> </settings>
H> </system.net>
H> </configuration>

You can do that without config file.
Take a look at
( http://forums.microsoft.com/MSDN/Sho...96969&SiteID=1 )

However, this way uses undocummented stuff that can change in the future.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Apr 5 '06 #2
wow i didn't think it would be this complicated.

thanks ill try it out.
"Vadym Stetsyak" <va*****@ukr.net> wrote in message
news:Os**************@TK2MSFTNGP05.phx.gbl...
Hello, Howard!

H> <configuration>
H> <system.net>
H> <settings>
H> <httpWebRequest useUnsafeHeaderParsing="true"/>
H> </settings>
H> </system.net>
H> </configuration>

You can do that without config file.
Take a look at
( http://forums.microsoft.com/MSDN/Sho...96969&SiteID=1 )

However, this way uses undocummented stuff that can change in the future.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

Apr 5 '06 #3
Im not using any COM dlls, all .NET

just hardcode the app.config settings in my source code.

there has to be a way...scratch head
"Vadym Stetsyak" <va*****@ukr.net> wrote in message
news:Os**************@TK2MSFTNGP05.phx.gbl...
Hello, Howard!

H> <configuration>
H> <system.net>
H> <settings>
H> <httpWebRequest useUnsafeHeaderParsing="true"/>
H> </settings>
H> </system.net>
H> </configuration>

You can do that without config file.
Take a look at
( http://forums.microsoft.com/MSDN/Sho...96969&SiteID=1 )

However, this way uses undocummented stuff that can change in the future.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

Apr 5 '06 #4
You can certainly declare a public or static class member that is a boolean,
and use that when you create a WebRequest in your class. However, what I
think is confusing you is that a config file is an XML text file, which
represents data. That same data, in a binary, would not be encoded as XML,
which is used for text representation of data.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Howard" <ho*******@yahoo.com> wrote in message
news:uP**************@TK2MSFTNGP05.phx.gbl...
How do I hardcode config properties in my binary?
I would like to put this app.config into my c# source code

<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true"/>
</settings>
</system.net>
</configuration>

Is this possible?

Apr 5 '06 #5
Hello, Kevin!

KS> You can certainly declare a public or static class member that is a
KS> boolean, and use that when you create a WebRequest in your class.
KS> However, what I think is confusing you is that a config file is an XML
KS> text file, which represents data. That same data, in a binary, would
KS> not be encoded as XML, which is used for text representation of data.

IMO OP here meant that he wants do the same setup actions ( that are stated in config ), but without actually using config file - that is using some kind of API.
Setup action here will be setting flag, that will influence HTTP data parsing process ( useUnsafeHeaderParsing ).

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Apr 5 '06 #6
Hi,

You can include any file you want in your binary, the problem in this case
is that you cannot use the default framework config class. You will have to
implement your own.

IIRC there is one Config class just like that as part of the opennetcf.org
framework, download it and use the class, but instead of reading a file you
read it from a file you read it from the resources.

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Howard" <ho*******@yahoo.com> wrote in message
news:uP**************@TK2MSFTNGP05.phx.gbl...
How do I hardcode config properties in my binary?
I would like to put this app.config into my c# source code

<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true"/>
</settings>
</system.net>
</configuration>

Is this possible?

Apr 5 '06 #7
Yes, this can be done. See:

http://forums.microsoft.com/MSDN/Sho...96969&SiteID=1

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"Vadym Stetsyak" <va*****@ukr.net> wrote in message
news:OZ**************@TK2MSFTNGP02.phx.gbl...
Hello, Kevin!

KS> You can certainly declare a public or static class member that is a
KS> boolean, and use that when you create a WebRequest in your class.
KS> However, what I think is confusing you is that a config file is an XML
KS> text file, which represents data. That same data, in a binary, would
KS> not be encoded as XML, which is used for text representation of data.

IMO OP here meant that he wants do the same setup actions ( that are
stated in config ), but without actually using config file - that is using
some kind of API.
Setup action here will be setting flag, that will influence HTTP data
parsing process ( useUnsafeHeaderParsing ).

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

Apr 5 '06 #8
Hello, Kevin!

KS> http://forums.microsoft.com/MSDN/Sho...96969&SiteID=1

:8-)) Thats the same link I've alread posted.

IMO based on the link we can say that we're not using config in the file form.
Yes, we access classes that use that config, but we do not have to supply config file - its all in code...

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Apr 5 '06 #9
how do I implement this code??
where should I make the call from? in program main?

sorry, but im a little confused. i thought it would be something like this

system.net.configureation.httpwebrequest.useUnsafe HeaderParsing = true;
"Vadym Stetsyak" <va*****@ukr.net> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Hello, Kevin!

KS> http://forums.microsoft.com/MSDN/Sho...96969&SiteID=1

:8-)) Thats the same link I've alread posted.

IMO based on the link we can say that we're not using config in the file
form.
Yes, we access classes that use that config, but we do not have to supply
config file - its all in code...

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

Apr 5 '06 #10

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

Similar topics

4
by: Lampa Dario | last post by:
Hi, I need to estract single characters in a string, that may be '0' or '1', and evaluate them. I defined these variables char *binary; char cypher; int value;
1
by: Gene Kahn | last post by:
Hello, How do single-file databases do it? If a database has, say, 10 tables, does that mean that the single-file is just a trick to hold ten separate 'boxes' inside, one for each table, or...
4
by: Pieter | last post by:
Hi, I have a variable (m_sngPrixNetUnitaire) which is of type Single. When I want to write the value to my SQL SERVER 2000, I put this value in my DAL (MyDal.PrixNetUnitaire), which is of...
13
by: Kevin Walzer | last post by:
Which of the Windows/Unix package builders for Python applications is capable of creating single-file executables? I'm thinking of: 1. py2exe 2. Mcmillan Installer/PyInstaller 3. cxfreeze ...
10
by: free2cric | last post by:
Hi, I have a single link list which is sorted. structure of which is like typedef struct mylist { int num; struct mylist *next;
9
by: Howard | last post by:
How do I hardcode config properties in my binary? I would like to put this app.config into my c# source code <configuration> <system.net> <settings> <httpWebRequest...
10
by: underground | last post by:
I need a little help figuring this one out. I have a script that I've modified to post mutiple binary files into a single row but instead of copying the indiviuals files it rewrites the first file to...
0
by: Atos | last post by:
SINGLE-LINKED LIST Let's start with the simplest kind of linked list : the single-linked list which only has one link per node. That node except from the data it contains, which might be...
6
by: ChipR | last post by:
I'm using Access 2007 on Windows XP, and I just noticed a total on one of my forms was wrong. It came down to Dim single1 As Single Dim single2 As Single Dim single3 As Single ...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.