|
Hello Everyone,
I have developed a simple MDI forms application and am now stuck with a problem. I want to store the data of each childform in a seperate tag of an XML file. I have written a xml_write() method in the childform.cs but am not able to successfully write for each MDI childform.
Can I get some help!!
KR
|
|
|
|
|
You'll have to be more specific,
what happens when your write function is called?
are any exceptions thrown?
Maybe show some code??
If you don't give details then no one can help you
Kev
|
|
|
|
|
I have attached the code of the method I have written in the ChildForm.cs file but this is not the right code coz I am not able to append nodes to the XML file using this. My problem - I want to add a node with some text to the XML file whenever I open a new child window using normal MDI property.
private void Xml_Creation(int count)
{
XmlWrt = new XmlTextWriter("XMLSample.xml",null);
XmlWrt.Formatting=System.Xml.Formatting.Indented;
XmlWrt.WriteStartDocument();
//start the first element.
XmlWrt.WriteStartElement("FORMS");
//create our first customer element.
//this is a child element of the customers element.
XmlWrt.WriteStartElement("Form");
XmlWrt.WriteElementString("FormNumber", count.ToString()); XmlWrt.WriteEndElement();
//XmlWrt.WriteEndDocument();
//XmlWrt.Flush();
XmlWrt.Close();
}
Cheers
KR
|
|
|
|
|
Hello!
I have the following problem.
I've created windows service on MS Visual Studio 2005
and I am trying to install it using InstallUtil.exe which is in Framework 2.
I need to pass parameter to the executable file of the service.
I override method Install of my ServiceInstaller the following way:
public override void Install(IDictionary savedState)
{
Context.Parameters["assemblypath"] += " parameter";
base.Install(savedState);
}
When InstallUtil finishes working I have my installed service but in Executable File I have the value of Context.Parameters["assemblypath"] placed in double quotes:
"C:/.../myservices.exe parameter". When i try to start this service I have "File Not Found" exception. I replaced double quotes in regedit and service started normally.
The question: Is there any normal way to install service so that it wouldn't have double quotes, or the executable path would look like: "C:/.../myservices.exe" parameter.
Thank you for possible answers!
Dmitry Uvarov
|
|
|
|
|
Dear Experts,
I would like to get the parameter "Path to Executable" of a Windows Service programmatically. As you know, we can use Service MMC snap-in (Control Panel --> Services) to adminstrate Windows Services. If you right click any one of the Windows Services and then choose Properties, you would see the Service snap-in.
In the Service snap-in, there is an item called "Path to Executable" that shows you the original location of your Windows Service's executable. Now I would like to get this path programmatically. Could you please tell me how I can achieve that?
Many thanks for your help.
Tigger
|
|
|
|
|
Hi all,
i have an MDI form and i have made the FormBorderStyle to None,
due to which the title bar of the form is not shown,
i have placed a picturebox on the left top corner of the form and i want
to display the system menu when the mouse button is pressed on the picturebox.
This system is displayed when we press the mouse down on amy windows application icon or on the right click of the title bar.
waiting for a quick reply.
Thanks,
Pramod
|
|
|
|
|
I don't know how to tie into the windows system menu but the options contained in it would be very simple to write in your own context menu that you could display when the picture box is clicked.
Kev
|
|
|
|
|
Thanks for the advice, but i have kept that as the last option.
i would like to use the system menu that windows provides.
Thanks,
Pramod
|
|
|
|
|
Hi guyz, can any one know how can i get the virtual path of the website, i used Httpcontext.current.Request.physicalapplicationpath but its not working. error occured like d:\websitename\specialoffer\banners path could not found. is there any else method to locate the desired path virtually. Thanx in advance please help me ou.
Regards,
Raheel
|
|
|
|
|
|
i hav used ajax in application .
Its working fine at my local system.
but when i go live it gives error.i think problem is in trust level in web.config.
How do i set this trust level in web .config
any body can help.its urgent
thanks & regards
cheers
Sanjeev
|
|
|
|
|
try
<identity impersonate="true">
right under<authentication mode="Windows">
if it doesnt work then you will have to open up your machine.config
find tag <processmodel ....
your="" machine.config="" will="" be="" found="" under="" this="" path
c:\windows\microsoft.net\framework\v1.1.4322\config
you="" edit="" processmodel="" tag="" like="" following:
look="" for="" attributes="" "username"="" and="" "password"
<processmodel="" enable="true" timeout="Infinite" idletimeout="Infinite" shutdowntimeout="0:00:05" requestlimit="Infinite" requestqueuelimit="5000" restartqueuelimit="10" memorylimit="60" webgarden="false" cpumask="0xffffffff" username="machine" password="AutoGenerate" loglevel="Errors" clientconnectedcheck="0:00:05" comauthenticationlevel="Connect" comimpersonationlevel="Impersonate" responsedeadlockinterval="00:03:00" maxworkerthreads="20" maxiothreads="20">
hope it will help
Osama Mirza
|
|
|
|
|
sorry, I forgot to not put tags in reply
correction of the above answer
->> right under authentication tag add another tag
identity impersonate="true" (make it complete tag with less than and greater than and empty tag /)
sorry for that
in machine.config you will may put username="machine" and for password="AutoGenerate". its not the best practice but you can try this to see if it works then make a custom policy and apply that policy on your required assemblies/user you are using either in identity tag or processmodel tag
Osama Mirza
|
|
|
|
|
im hostimg my site on some one other's server and i dont hav access to machine.config.
Is there any way to override machine.config settings from my web.config.
Its urgent.
thanks sanjeev
|
|
|
|
|
To get Msgbox in VB to C#
|
|
|
|
|
Would be nice if you formulated a real question next time.
Probably System.Windows.Forms.MessageBox.Show(...) is what you are searching for.
|
|
|
|
|
Hi, can someone please tell me how to send a struct to a different class file.
In the other class file (receiving end) you have to specify the type that is sent to it. What must I put there, 'struct' doen't work.
|
|
|
|
|
use the struct name which you have defined not the struct keyword.
|
|
|
|
|
Hard to understand your question but I'll try it:
public struct MyStruct {
}
public class MyClass2 {
private MyClass1 _myClass1;
public void DoSomething() {
_myClass1.Send(myStruct);
}
}
public class MyClass1 {
public void Send(MyStruct myStruct) {
}
}
You have to use the name of the structure (the same as if you would use a normal class).
|
|
|
|
|
Works if both classes are in the same file, but I want to do it between 2 different
files.
//DrawGraph.cs
public partial class DrawGraph
{
public struct Data
{
public int a;
}
public void DoSomething()
{
Draw draw = new Draw(); //Create an instance of Draw.cs class file
Data data = new Data(); //Create an instance of Data struct
data.a = 5;
Image1.ImageUrl = draw.DrawGraph2(data); //Sending struct to Draw.cs class,DrawGraph2 method
}
}
//Draw.cs
public class Draw
{
public String DrawGraph2(@Data@ data) // what must I put between the @ signs
{
String img = "whatever";
return img;
}
}
|
|
|
|
|
try
using namespace1(in the second file)
in datatype
use DrawGraph.data
|
|
|
|
|
Gives me:
The type or namespace name 'namespace1' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'DrawGraph' could not be found (are you missing a using directive or an assembly reference?)
I want to send about 30 variables through the struct, coz with struct its easy and nice to access or change the values of variables.
I've read somewhere that its not good to send too much through a struct.
Should I just send the variables directly then?
|
|
|
|
|
Substitute "namespace1" with the name of the namespace containing the struct.
If the namespacec are in different assembplies, you also have to add a reference to the assembly containing the struct.
---
b { font-weight: normal; }
|
|
|
|
|
nm
Thanking You.
Sincerely,
VIRAL PATEL
|
|
|
|
|
VanEtienne wrote: Works if both classes are in the same file, but I want to do it between 2 different
files.
as long as the struct is declared as public it should be no problem. same syntax / method as passing a class an instance of another class.
|
|
|
|