|
I don't think what you are trying to do is possible. As far as I know, .config files can only be used with applications (theapp.exe.config) or ASP.NET (web.config).
You would find that if your COM+ application used Server (as opposed to Library) Activation, to config file that the .NET framework would try to load would be dllhost.exe.config .
I assume one could try to force the .NET classes used to read the configuration to load the info from a specific file, but I've never used them myself (I don't even know which are used )
If anyone knows any better, or if I am talking rubbish, please correct me.
Searching the web without Google is like straining sewage with your teeth. Userfriendly, 2003/06/07
|
|
|
|
|
I can't use the COM+ application like Server because I don't want to have any dll in the GAC. I want to use probing to indicate where my application has to search for the asssemblies.
I could use another file to read the configuration information, like you said, but the probing information, as far as I know, has to be in the application config file.
Any other suggestion??
Thanks!!
Iván Fernández
|
|
|
|
|
What it comes down to is the CLR host. The ASP.NET host is hardcoded to use the Web.config file as its configuration file. The executable loader by default uses yourapp.exe.config. In your case, it's odd that aspnet_wp.exe.config is being used.
In any case, if you are using a wrapper, perhaps your wrapper has a chance to create the AppDomain that hosts the COM+ service itself? If so, when you are configuring the AppDomain , you can specify any .config file you want so long as the CLR can resolve the location. See AppDomain.SetupInformation for more details.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
How do I allow my web visitors to:
video conference, create private rooms, exchange
files much like "MSN Messenger" but embedded in my
web page?
|
|
|
|
|
Hello,
I am trying to implement an asp.net page which will move a file from a folder on the web server to another server. I have the following code:
File.Move("E:\temp\image.gif", "\\dnssvr1\Ad\image.gif");
When I try this, I am getting some sort of error about a username and password. Is there a particular place where I have to set a username and password? Do I need to specify the path to the destination differently?
Thanks,
RC
|
|
|
|
|
This means you (or whatever credentials the app is running under) don't have permissions to the remote resource. Either make sure your domain account has appropriate permissions to that directory (or, in some cases, that a local user with exactly the same username and password exists on both machines - such as on a workgroup), or use impersonation for someone that does. See WindowsIdentity for easy impersonation in .NET.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I am looking to create a class that uses given paramaters will generate an image, the resulting image is then fired into a picture box and the world is happy.
Problem is all the GDI (ish) tutorials I have come across assume that I am generating the images within the actual form that displays them and not an external class.
Is there a way of achieving this?
As an example, I have the following code in my form :
picturebox1.Image = new MyEllipse(200);
And this code in my class :
public Image MyEllipse(int height)
{
//ellipse generatation code here
return img;
}
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
You're not looking at the right tutorials, then. The principal is the same, though - you need a surface to draw on. So create a bitmap and use the Graphics device to draw on it:
Bitmap bmp = new Bitmap(32, 32);
Graphics g = Graphics.FromImage(bmp);
g.FillRectangle(new SolidBrush(Color.White), 0, 0, 32, 32);
g.Dispose();
return bmp; See the Bitmap and Graphics class documentation for more details and sample code.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thankyou very much
That is exactly what I needed, I am now inundated with a myriad of dynamic pie charts
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
hi
Can anyOne send me the source code of Flow Diagram or like this software.
Flow Diagram is a softWare that we used it for drawing flowchart or other like DFD or ERD Diagrams.
Best Regards
Alireza Meshkin
|
|
|
|
|
Sure - I've got some under the desk here.....
Actually, I believe there is a free library that does this kicking around. But this forum is really for programmers, not people looking for freebies, so you'll have to google it.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I'm struggeling a bit here.
I'm trying to save a TreeView and all of it's nodes as shown in the code belowe:
xw.WriteStartElement("TreeView");
foreach(TreeNode tn in theTreeView.Nodes)
{
xw.WriteStartElement("TreeNode");
xw.WriteAttributeString("Text", tn.Text);
if(theNode.Parent == null)
{
xw.WriteAttributeString("Parent", "null");
foreach(TreeNode n in tn.Nodes)
{
xw.WriteStartElement("TreeNode");
xw.WriteAttributeString("Text", n.Text);
xw.WriteAttributeString("Parent", n.Parent.ToString());
xw.WriteEndElement();
}
}
xw.WriteEndElement();
}
xw.WriteEndElement();
The xml file looks something like this:
<treeview>
- <treenode text="Startnode" parent="null">
<treenode text="Node0" parent="TreeNode: Startnode">
<treenode text="Node3" parent="TreeNode: Startnode">
<treenode text="Node4" parent="TreeNode: Startnode">
- <treenode text="Node5" parent="null">
<treenode text="Node6" parent="TreeNode: Node5">
The problem is that I only get the first nodes and the second nodes in the TreeView hirarki. If I continue to add a foreach(TreeNode n in theNode.Nodes) I will end up writing it forever...
Is there a better way of getting all the nodes in the TreeView than
foreach(TreeNode n in tn.Nodes)?
or what must I do?
Thanks in advance for your help ,
Thomas
|
|
|
|
|
You have heard of recursion, right?
private const string xmlns = "urn:myTree";
private const string prefix = "t";
public void WriteToXml(TreeView view)
{
XmlTextWriter writer = new XmlTextWriter("somefile.xml", Encoding.UTF8);
writer.WriteStartDocument();
writer.WriteStartElement(prefix, "treeView", xmlns);
foreach (TreeNode node in view.Nodes)
this.WriteToXmlHelper(node, writer);
writer.WriteEndElement();
writer.WriteEndDocument();
}
private void WriteToXmlHelper(TreeNode node, XmlTextWriter writer)
{
writer.WriteStartElement(prefix, "treeNode", xmlns);
writer.WriteStartAttribute(prefix, "text", xmlns);
writer.WriteString(node.Text);
writer.WriteEndAttribute();
foreach (TreeNode node in node.Nodes)
this.WriteToXmlHelper(node, writer);
writer.WriteEndElement();
} Recursion is the best way of handling hierarchical data. This example also writes out a hierarchical XML structure which is easier to resolve then following IDREFs and what not (since it looks like you're venturing down that road).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi,
Does anyone know of a good XML Comment documentation tool that allows custom xml elements. I am looking to include things like history information (you know author, date/time, reason). I've looked at NDoc which produces great output but doesn't seem to handle custom XML elements and is full of bugs.
Regards,
Colin.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
The most popular free tool is NDoc, which yours truly also works on. (And I'm not just saying it's the most popular because I do work on it - look at the companies that use it!)
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
is it possible to customise the default MS date time picker control so that it will only allow you to pick :
1) Month & Year
2) Just year
I know this could easily be done with combo boxes etc, but it would be nice to be able to do this directly through the pickers
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
First, changing the DateTimePicker to only allow these things either drastically cuts down on the user interface - thereby making the control unnecessary bloat - or pisses off the user because they think they can select a date but only the month and year are used. From a UI perspective, this is a bad thing.
Now, while you can't change the UI in that way (other than overriding WndProc and attempting to use windows messages and notifications to do so), you can specify a custom format that the textbox portion of the DateTimePicker displays with the CustomFormat or Format property. This way, at least the user has some idea that only the month and / or year is valid.
When you get the Value (a DateTime structure), just grab the month and / or year and forget the rest.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
In the end I have opted for combo boxes.
The reason being is that I wanted to restrict the visuallity of the pickers so that on drop down they only showed Year or Month/Year. This would have also bypassed the problem of the user knowing that the particular picker will only allow them to choose a Year or Month/Year.
It would have been feasible to use the pickers as they are and just pull the necessary data from the resulting value, but this would mean problems for the user when selecting wildly different dates (i.e. if March 1953 is currently selected, it would take a while to get to April 2005 - now they could type the value, but that defeats the point of a picker)
After much fiddling, and your comments, it is obvious that combo boxes are the best way to go.
post.mode = signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
How can I convert a string to System.Drawing.Color?
I'm saving a color in a xml file:
xw.WriteAttributeString("BackColor", theButton.BackColor.ToString());
The file contains:
BackColor="Color [A=255, R=255, G=255, B=0]"
or
BackColor="Color[Black]"
I then read it back:
strColor = reader.Value;
Thanks in advance for your help ,
Thomas
|
|
|
|
|
thomasa wrote:
How can I convert a string to System.Drawing.Color?
For named colors: Color.FromName
Of course for the other you will have parse the colors and push them in via Color.FromArgb
Rocky <><
www.GotTheAnswerToSpam.com
|
|
|
|
|
Given:
System.Drawing.Color obj;
string name;
Color to String:
name = obj.ToString();
String to Object:
obj = System.Drawing.Color.FromName(name);
|
|
|
|
|
I've built my Windows Form application with form's localizable property set to true, then configure support for different languages by setting Language property to fr, fr-CA, fr-fr, de, en, en-US, en-UK. I checked, the satellite assemblies were all there in the right subfolders after I compiled the application.
I execute the application on my machine, and since it's a "en-us" machine, I get the corresponding UI elements displayed with the corresponding english labels.
But, how can I change the CurrentUICulture of my "machine" - so I can see what the GUI looks like under different machine culture setting? I tried Control Panel>Regional and Language Options. I changed settings on "Regional Options" tab, but nothing I did seems to affect how my application chooses its satellite assembly: It always chooses "en-US" despite of the changes???
Thanks in advance.
|
|
|
|
|
Changing the regional settings - unless you have the appropriate MUI packs for the version of Windows you're running (only on 2000 and XP currently, I believe) - doesn't change your language.
Instead, you need to provide a way to change it in your application. If you make a user preference to do this, you have to reset the controls based on the localization information in the satellite assembly. You don't have to re-instantiate the controls or add the controls to their would-be parent's Controls collection, but you do have to do practically everything else.
An easier way would be to add a key/value pair (say, "language", then the 5-digit lang-culture pair as the value) to your <appSettings> . In your application - either as the first lines in the main forms's constructor, or before you call Application.Run - read the setting with ConfigurationSettings.AppSettings["language"] . If a setting exists, set Thread.CurrentUICulture = new Culture(myLangSetting) . Any other threads that are spawned from the main thread (which the UI must add, remove, and usually update controls on) should inherit the setting from the thread that spawned them.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks, I can see what you're getting at. I'll just put a Dropdown box and let user to select CurrentUICulture.
|
|
|
|
|
Actually, I think you missed my point. If you use a drop-down, this implies that you're UI is already running (unless you use a modal dialog before calling Application.Run , which can be tricky depending on a number of factors). If you do this, to change the UI culture you have to completely reset EVERY SINGLE CONTROL in your application. This is especially tedious when you have multiple forms. Switching languages while a program is running - especially larger programs - is definitely not a trivial thing.
If users require different languages on their Windows machine, then they might just have the appropriate MUI pack installed and enabled. They will see the appropriate localized UI automatically. If you just require this for testing, use the config file. If nothing else, companies that require a different localized UI can change the config file when - for native applications - they would change the registry (using the registry for .NET apps is not recommended). It's not like users are going to be changing the UI culture often, right? Why make it much more difficult on yourself.
That's what I was getting at - keep it simple. Assign the UI Culture before you start your application (which means the main UI thread, which will effect all threads spawned from it). You'll save yourself A LOT of trouble.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|