|
using System;
Int16 nError = AxABCTL1.ErrorCode; /ravi
|
|
|
|
|
Could anyone explain me, how I can start Lotus Notes (Version V5 or V6 or V7)
in C#.NET 2.0 with an attachement?
Thanks for your help.
Kind Regards
Daniel
|
|
|
|
|
mailto:s@s.com?cc=s@s.co.uk&attachment=""c:\test.txt""
If at first you dont succeed, look for directions in the trash.
|
|
|
|
|
Thanks for your help.
I just tried your version of mailto on the commando line but
the lotus notes was opend without any attachement.
Whats wrong with it?
Is there a direct way to open lotus notes from C# codelines?
Kind Regards
Daniel
|
|
|
|
|
Hello everyone,
Thanks for all the help donr by u guys till date.
I need one more help. The situation is
I am calling an exe from my C# program. My C# program is a windows forms program. But that exe pops up a console. And that Console mark remains on my form.
Please if u can help me eighter to know how to supress that console or how to refresh my picture box which is on the fom it will be of great help.
I have used picturebox.refresh function , it removes the image also from the picture box. So plz help me in this regard
Thanks and Regards
Pavan Joshi
|
|
|
|
|
I wish this helps ;
// With psi, you have to point out your executable file
ProcessStartInfo psi = new ProcessStartInfo();
psi.CreateNoWindow = false;
psi.WindowStyle = ProcessWindowStyle.Hidden;
|
|
|
|
|
hi all,
how can i create a public variable like
string vb="ddd";
i just use vb value any class. how can i do this
sdfsdfsdfs
|
|
|
|
|
C# doesn't permit global variables. The best you can do is create a class with a static member like this
class YourClass
{
public static string vb = "ddd";
}
...
void YourMethod()
{
string f = YourClass.vb;
}
|
|
|
|
|
If I'm not mistaken, YourClass needs to be public ?
/ravi
|
|
|
|
|
The default accessibility for a class is internal , so as long as the class is used within the same assembly, it should work fine. Otherwise, as you said, the class needs to be public.
|
|
|
|
|
|
I am trying to read an XML file and break it up into smaller chunks but am having real problems in doing so as I have never used XML (and am new to C#), so would appreciate any help possible. The problem is in two parts:
1) I have a file with some beginning header info, i.e. along the lines of:
<?xml version=”1.0” encoding=ISO-8859-1” ?>
<!—some comments -->
<message xmlns:xsi=”http….”…>
<header>
<more header stuff>text here</more header stuff>
<some more header stuff>text here</some more header stuff>
</header>
I wish to add this to every new XML document I create but am having problems when trying to write it.
2) I then wish to read a large XML document and cycle through it, copying each record to a new file that I have created (with the above header info), until I have 100 records, then start again. The format of the records is:
<Record>
<attribute1>blah blah</attribute1>
<attribute2>blah blah</attribute2>
<attribute3>blah blah</attribute3>
</Record>
I know that I need a for-loop to do this, but not having any experience of XML with C#, I don’t know what is needed to complete this task. Can anybody help please?!
Thank you to all who can assist!
|
|
|
|
|
Have a look at the System.Xml.XmlDocument[^] and related classes. They allow you to load the the XML file into memory and perform operations like addition/removal of nodes. In particular, pay attention to the CreateNode[^] and Save[^] methods.
|
|
|
|
|
Thanks for your help Senthil. But do you (or anybody) have anything a bit simpler you could point me towards; something that would make a bit more sense a bit quicker, rather than having to read class definitions?
Thanks
|
|
|
|
|
|
Thanks for your help so far. I have been working away and had some success; I can create a new XML file which prints the header info, then begins to cycle through and print the records as expected (hoped!). However, it crashes at the end with the following error:
"A name was started with an invalid character. Error processing resource 'file:///C:/..."
Also, the second file is created but cannot even be displayed, as it shows the following error:
"XML document must have a top level element. Error processing resource 'file:///C:/..."
My code for this is as follows:
while (fileReader != null)
{
// Create a file to write to
XmlTextWriter fileWriter = new XmlTextWriter(directory + "\\Output" + x + " myFile.xml", System.Text.Encoding.GetEncoding("ISO-8859-1"));//null);//System.Text.Encoding.UTF8);
// Write the header details to the new file
fileWriter.WriteProcessingInstruction("xml", "version='1.0' encoding='ISO-8859-1'");
fileWriter.WriteStartElement("!-- My comments go here --");
fileWriter.WriteStartElement("message");
fileWriter.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
fileWriter.WriteAttributeString("xsi", "noNamespaceSchemaLocation", null, "myXSDdoc.xsd");
// Add 'messageHeader' as the element to enclose records in the file
while (fileReader.Name != "messageHeader")
{
fileReader.Read();
}
fileWriter.WriteNode(fileReader, true);
// Write each row to the file, until 1000 records have been written
for (int i = 1; i <= 1001; i++)
{
while (fileReader.Name != "KeyRecord")
fileReader.Read();
fileWriter.WriteNode(fileReader, true);
fileWriter.Flush();
}
// Tidy up and close the file so that a new one can be opened
fileWriter.WriteEndElement();
fileWriter.Close();
x++;
}
Can anybody please help me with these errors? Thanks
|
|
|
|
|
Dear every one,
I am new in C# and I have a question about call function between two windows forms.
In my project I have two windows form (form example Form1 and Form2) Form1 has some functions for itself(for example Func1,Func2,..) and Form2 has another functions (for example TempFunc1,TempFunc2,..).I'd like to call Func1 via Form2,I mean when the program is running and the TempFunc1 from Form2 is doing I want to call Func1 from Form1,how can I do this?
Please help me.
Yours Sincerely.
Orchid
|
|
|
|
|
The main way to do this is to create delegates, so that your forms can call functions within each other. If you want something more quick and dirty, pass an instance of each form to the other form, and make the methods public.
We need a FAQ, and this needs to be the first item on it. In fact, I thought we had one ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: We need a FAQ, and this needs to be the first item on it. In fact, I thought we had one ?
This has been a long....long...did I say long running feeling. Heath Stewart and I started one about 3 years ago. I don't think it ever came to fruition.
|
|
|
|
|
you could use of this function such as using a function in a class .
Create a new instanse of ur form class and then call your function
|
|
|
|
|
See this article: Passing values between Forms in .NET[^]
It passes values through properties - but properties are just syntactic sugar over getter and setter methods, so it works just as well for calling regular methods.
|
|
|
|
|
hi,
in c i wrote this: int pcread[250];
how do i write this in c#
its something like int pcread= new ....
anybody?
|
|
|
|
|
int[] pcread = new int[250];
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
|
Morning all,
I was wondering if somebody could answer a simple question.
Using VS2005 I have a C# form connected to a Typed DataSet.
On this form I have a number of Textboxes that are DataBound to a Binding source, this is all fine, but I want to allow the user to edit the text without direct updates to the datasource. To implement this, I call suspendbinding on the binding source, but this clears the text boxes. Is there any way to prevent the text boxes clearing when suspend is called??
Thanks
Paul
|
|
|
|