|
XmlElement 's have a PrependChild Option that add the node as the first child, so:
<br />
XmlElement farmelement = xmldoc.CreateElement("farm");<br />
xmldoc.DocumentElement["farm-config"].PrependChild(farmelement);<br />
|
|
|
|
|
hi,
These contents i want to insert after farm elements where farm is equal to dev2
<database state="0" name="one" sourceType="amacs">
<database>
I want Xml(database) to be inserted after farm where farm is equal to "dev2"
I am giving you the structure of XML file
<?xml version="1.0" encoding="UTF-8"?>
<root>
<farm-config>
<farm name="dev1">
<connection address="localhost" user="root" selectedConnection="1" password="ram">
<lastJob>Copy-All</lastJob>
<lastConnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>
<database state="0" name="bd_plc1_house1_14022005" sourceType="amacs">
<tables state="0" name="feed_delivery">
</table>
</database>
</farm>
<farm name="dev2">
<connection address="localhost" user="root" selectedConnection="1" password="ram">
<lastJob>Copy-All</lastJob>
<lastConnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>
</farm>
</farm-config>
</root>
pls send me code for that
regards
sanjeev
|
|
|
|
|
Hai all,
i have developed a program and i want make it as demo version .....
how shuld write code such that my demo version expires once the date of expiration crossed.
if i create a table with start date as column ,what if user changes the date?
shuld i need to encrypt the date or is there any other way >
help me out
regards,
RANA
|
|
|
|
|
i need help to set Html file as a desktop wallpaper using C#
thx for ur interest
|
|
|
|
|
I have gone back to the original synchronous client/server code, however keeping the BeginAccept and EndAccept in order to alleviate the need for a keep alive. I have now run into a final problem being Encoding and streaming.
1) What would be the best Encoding for sending String messages but also files? (Is there 1 encoding that could handle both?) I have had success just opening a file, converting to UTF8, converting back to Default, then writing to another file, but somewhere along the line my client/server code muffles the data.
2) Should I use the socket stream or the socket directly for sending/receiving? Is there any real difference (IE socket.Send(..) streamWriter.Write(..)) Currently I'm using a mixture of both and I don't think that it is good coding.
Thanks in advance.
|
|
|
|
|
We have developed a framework lib in C# that will be used by many of our Apps. For tracing purpose we use .Net reflection and log all the Class elements as the messages flow through various layers of each assambly. But we are unhappy with this generic logic because we end up logging a lot of class members that are needless to be logged.
Can we use custom attributes for overcoming the problem? The message classes will dictate which all class members should become a part of the trace logs.
Will be grateful for anyone who can give suggestions. Thanks.
Regards,
Senthil.
|
|
|
|
|
I think this can help u:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkattributestutorial.asp
|
|
|
|
|
Can on use "transforming" and "stretching" to copy a part of one picture to another picture object.
Thanks
|
|
|
|
|
You can use Graphics.DrawImage to draw part of one image onto another.
Just use:
Graphics g1 = Graphics.FromImage(destinationImage);
g1.DrawImage(sourceImage, you can specify source coordinates and destinartion coordiates here just lookup the many overload for DrawImage);
g1.Dispose();
|
|
|
|
|
Thanks for that
When I try that code i.e.
_____________________________________________________________________________
Graphics g1 = Graphics.FromImage(viewer1.Image);
g1.DrawImage(dxfdefaultBox.Image, new Rectangle(1,1,400,300),new Rectangle(1,1,1000,1000),GraphicsUnit.Pixel);
g1.Dispose();
_____________________________________________________________________________
I get a "An unhandled exception of type 'System.ArgumentNullException' occurred in system.drawing.dll".
viewer1.Image is stated as <undefined value="">
viewer1 does exist as a pictureBox on the form, and I can write directly to it through a device context -do you have any idea as to why it would appear as a null item in this use ?
Thanks
|
|
|
|
|
hi all,
I am doing a database Application using C# and SQL Server 2000.
my application is always running (24hours)..
while running the application,the sql server stop and connected.
after that the application generate error "GENERAL NETWORK ERROR..CONTACT YOUR DOCUMENTATION"
..
Can any ones please help me to solve the problem.?
thanks in advance..
|
|
|
|
|
Hi!
This info is too sparse to provide true help. But if I understand your request correctly, the SQLServer cannot be accessed after a while, correct?
The "GENERAL NETWORK ERROR" is in your app when you try to query the SQL Server?
If it's not happening immediately it sounds like a ressource leak.
Make sure you free/dispose of any connections you create after you don't need them anymore.
mav
|
|
|
|
|
Hi everybody,
I am trying to convert a project from VS 2003 to VS 2005. But i couldn't findout the csharpEmpty.vsz at C:\Program Files\Microsoft Visual Studio 8\VC#\VC#Wizards as in VS 2003. In VS 2003 it is located at C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\CSharpProjects\csharpEmpty.vsz.
Please any one help me to solve this problem, either by new path( I searched a lot , but ) or any other way to call an empty CSharp wizard.
|
|
|
|
|
Hi all
I have used this function
[DllImport("user32")]
public static extern int SetCaretPos(int x, int y);
public void setPos(int x1,int y1)
{
SetCaretPos(x1,y1);
}
to set the position of the caret cursor but it is not setting the position of the caret cursor at the given coordinate please help me out
|
|
|
|
|
I create 2 usercontrols: one is parent control that has a collection of child control. Both controls are inherited from panel. The problem is if i add child control into the parent control by using EditorAttribute(typeof(System.ComponentModel.Design.CollectionEditor), typeof(System.Drawing.Design.UITypeEditor)), everything looks fine, and I got both parent control and all child controls variable on the code at design-time.
However, if i try to add child control into the parent control myself by using IList.Add method or even Add method (the same method that the CollectionEditor call), it get problems: 1) The design view looks ugly and 2) the child controls variable doesn't appear on code. I don't know how the CollectionEditor create a new instance of the child control and add it to the parent control Anyone please help !!!
PS. For some reason, I need the child controls are created properly on the code.
|
|
|
|
|
Does some of you could tell me what's the function of the codes below:
Thanks!
void DisplayShape(bool Light)
{
HPEN hNPen,hOPen;
HBRUSH hOldBrush,hNewBrush;
COLORREF cfill;
if (Light)
{
if (cluminance == 3) return;
cluminance = 3;
cfill=RGB(0,255,0);
}
else
switch(cluminance)
{
case 3: {cluminance--; cfill=RGB(64,255,64); break;}
case 2: {cluminance--; cfill=RGB(128,255,128); break;}
case 1: {cluminance--; cfill=RGB(192,255,192); break;}
default: cfill=RGB(255,255,255);
}
hdc = GetDC(hWndG);
hNPen=CreatePen(PS_SOLID,1,RGB(0,0,0));
hOPen=(HPEN)SelectObject(hdc,hNPen);
hNewBrush=CreateSolidBrush(cfill);
hOldBrush=(HBRUSH)SelectObject(hdc,hNewBrush);
Ellipse(hdc,393,235,443,285);
DeleteObject(SelectObject(hdc,hOPen));
DeleteObject(SelectObject(hdc,hOldBrush));
ReleaseDC(hWndG,hdc);
}
|
|
|
|
|
It's C Code. It draws an Ellipse, and every time it is called, the colour changes. It fades up to white, but not in greyscale, the green component is always 255.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
i'm working on an existing VC6 application which has a plugin architecture supporting dlls which export and accept pure virtual inteface pointers. ie after loading the dll, the exe calls an exported C function on the dll which returns a pointer to a PVI. the exe then calls methods on the pPVI somtimes passing back a pointer to another PVI for the dll to manipulate.
now, this is trivial using traditional c++ and i've done it many times but more recently people writing the plugins has asked to use c#, VB.NET and other more 'modern' languages. the trouble is that i've very little experience of .NET programming and the issues around allowing managed and unmanaged code to communicate. and the more i google the less clear it becomes.
any suggestions for further reading matter or urls to sample code would be sincerely appeciated.
.dan.g.
AbstractSpoon Software
|
|
|
|
|
how can i show the icon of my application on system tray bar when windows start up?
Thanks
|
|
|
|
|
Two different questions:
1) Icon in system tray: System.Windows.Forms.NotifyIcon is the class (and sample) you want.
2) Running on windows start: I don't know of any API for this but adding a registry key for your application will do:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
String Key: AppName
Value: Full Path to Exe
|
|
|
|
|
for the second answer:
how can i create a registry key during setup of my application?
on the value "Full Path to Exe", how can know it (and set it on setup time) if the user during the setup chooses a custom directory on its computer?
|
|
|
|
|
If you're using an MSI-type installer project in Visual Studio, you can add registry keys via the registry view of said project.
Drew Noakes
drewnoakes.com
|
|
|
|
|
hi
1) drag and drop the Notify Icon from the tool box.
2) In the Icon properties, you can set the Icon and Visble as true
Then it appears when to the tray bar.
3) Do you need to start the Program at the start up,Simple way is added to application shortcut start up directory or do it using setup wizard .
regards ,
pubudu.
|
|
|
|
|
I get an E_ACCESSDENIED error everytime I try to acquire the keyboard or mouse in anything other than background nonexclusive mode. I know that you can't do foreground in Visual Studio for the keyboard, but this happens even outside of it. Is it even possible to get anything else? I'd at least like foreground nonexclusive for the keyboard, and the same would be nice for the mouse but not as important.
EDIT: I set it up to unacquire the devices when the form is deactivated and reqcquire them when activated. This does the job but I'd still like to do it right.
|
|
|
|