|
jpk420 wrote: how CLR will locate its address using DLL Import
Just like any EXE locates functions in some DLL: searching the exported symbols table by name (there is a scheme using "ordinal numbers" too, AFAIK CLR doesn't use that).
The DllImport directive specifies the DLL name, the Windows system environment variable "PATH" tells which folders to search, the optional "EntryPoint" parameter inside DllImport allows you to rename the function.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Sorry i think that part of the code was a shorcut to some imoticon
Aman
|
|
|
|
|
Hi,
you need some variables when reading from the console. Here is a way to get a number (note the use of PRE tags for readability):
Console.WriteLine("please enter number:");
string s=Console.ReadLine();
int number;
bool OK=int.TryParse(s, out number);
if (OK) {
Console.WriteLine("You entered the number "+number);
} else {
Console.WriteLine("Unacceptable input: "+s);
}
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Dear Luc Pattyn,
Thank you very much for your help, however the brackets are still red and the error message is still there.
Thank you very much for oyur help and sorry for the inconvenience,
Aman
|
|
|
|
|
Hi,
what brackets? do you mean the parentheses?
did you put your code inside a method, the method inside a class, the class inside a namespace?
if there is an error message, give it as is.
if it specifies a line number, check that line.
work on the first error message first.
and teach your IDE to always show line numbers, see #102 here[^]
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Dear Luc Pattyn,
I have fixed this problem, the problem was that one of the settings for c# was changed. I dont know how that happened. I just reset all the settings to default and that worked.
Thank you very much for helping,
Aman
|
|
|
|
|
Hi Aman,
you're welcome.
BTW: Please don't delete any messages, they should remain visible to keep the thread intelligible and available for future reference.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi Luc,
Right sorry i just thought that if i kept it open people would have thought that this is still a issue/problem.
I did not know that you where ment to keep it open , thank you for telling me i now know
Thank you,
Aman
|
|
|
|
|
What you can do is:
- add "(SOLVED)" to the subject line of the original post
- click "good answer" on the reply that did it for you (that removes it from the "unanswered questions" list)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
THIS PROBLEM IS FIXED.
I would like to thank everybody that offered solutions and tried to help,
Aman
|
|
|
|
|
Thank you all for helping me solve this simple problem, i did not realise that my settings had been changed,
Aman
|
|
|
|
|
hello everyone out there!
I have one problem and I hope someone can help me. There is one project what I am working on and is mostly data scraping and saving data in xml document. I have an option to create lists and then add data to the lists. For example, the user can create list for restaurants, and I am creating xml document just with one xml element: <restaurants>.
Then once I have all the data scraped I want to add xml nodes with the data what I have to the existing document. I am trying something like this:
string path = Properties.Settings.Default.XMLFolder + list + ".xml";
XmlTextReader rdr = new XmlTextReader(path);
XmlDocument doc = new XmlDocument();
doc.Load(rdr);
XmlNode nodeBusiness = doc.CreateNode(XmlNodeType.Element, "Business", string.Empty);
nodeBusiness.Attributes.Append(attribute);
docData.AppendChild(nodeBusiness);
I am getting an error at the last step: "This document already has a 'DocumentElement' node."
Can someone help me to solve this issue, thanks in advance. Laziale
|
|
|
|
|
change it from :
docData.AppendChild(nodeBusiness);
to:
docData.DocumentElement.AppendChild(nodeBusiness);
|
|
|
|
|
Thanks a lot, that solved my problem. Have a nice day, Laziale
|
|
|
|
|
Hi,
I am developing one windows application in that i am trying to integrate microsoft word programatically. I used web browser control to enter text,saving it as a word document but the saved document is not showing page numbers,line numbers etc like normal word document. I want to display page numbers and line numbers to my word using web browser control.Can you please tell me is it the correct way to implement word in c# and can you please guide me how to assign page numbers and line numbers for web browser control.
Thanks in advance
Pavani
|
|
|
|
|
I want to create text file to my friends computer c drive in the lan.. Any code please
|
|
|
|
|
string s = "Hello World";
File.WriteAllText(@"c:\hello.txt", s);
|
|
|
|
|
Thanks but how can I include the IP Address?
|
|
|
|
|
"\\friendscomputer\c\hello.txt "
change "friendscomputer" with IP address
|
|
|
|
|
you need to change the c:\ to point to computer name \\friendscomputer\c\hello.txt
Weight loss Target
Weight at start [1/Feb/2009] 127kg
Weight now [31/Jul/2009] 107.7kg
Target weight : 80kg
Only 28 TO go hope to be there by March Wish me luck!
|
|
|
|
|
The error I get is that the network path cannot be found . We are using wireless we want to chat through codes. Even if I replace the path with my own IP. any idea
|
|
|
|
|
Easiest way would be to map a network drive and create the file with File.Create method using the specified network path
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
THE QUESTION IS HOW? how can I map it .. I need a simple code/process for that please
|
|
|
|
|
there is a command in xp, use it like this :
net use k: \\friendscomputer\c\public
run it using Process.Start
|
|
|
|