|
Heath,
Thanks. I had done a load of testing yesterday including creating a method CheckUserAppendingDomain with all of them failing. I realized later that security put me in the group yet I had not logged off and back on. After I logged back in to have my token properly set, I forgot to retest the CheckUserAppendingDomain. That worked!!!
Michael
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
Hello I'm really new to the world of programming
And I was wondering if anyone could give me a good source to learn C# from, or "mentor" me help me to get started on C#.
Hopefully when I'm a compitent programmer in C# I want to go on to to learn C++.
If anyone could help me get started I would be very greatful.
Thanks<blink>.
-=LoKi=-
|
|
|
|
|
|
I can't find what topic it's under,I really am an Absolute beginner,The titles of these topics mean nothing to me, Is there anywhere, or anyone who could help me start right from the beginning?
|
|
|
|
|
SO LEARN. Are you just going to go through guessing and without research skills. The link I gave you is to a similar question where I and a bunch of others posted various web sites where you can start learning.
This site is to help community members - not teach you from scratch. There are many tutorials for beginners and lots of articles for intermediate and advanced readers. There are hundreds of books about .NET and C#. There's the MSDN Library that has the complete .NET SDK class library reference plus gigabytes of other information (not including the downloads!). It's all out there.
Besides, how is any one of us supposed to host a class for you? You have to take the initiative yourself. For all of us in these forums that typically are the ones answering questions - how do you think we learned?
Pick up one of many books from Microsoft Press or visit that link I gave you originally and look at the replies for many sites to help get you started. Good research skills are crucial to being a developer. This isn't like flipping burgers were you get trained to know everything you should. This is an ever-growing field with limitless possibilities and hundreds of languages, frameworks, and platforms on which to solve problems.
-----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-----
|
|
|
|
|
You should get Mastering Visual C#.NET by Jason Price and Mike Gunderloy. Sybex publishing, ISBN: 0-7821-2911-0
|
|
|
|
|
Below is my code
try
{
DirectoryEntry m_de = new DirectoryEntry("IIS://localhost/w3svc/1");
int i=0;
object o=i;
o=m_de.Invoke("Status",new object[0]);
m_de.CommitChanges();
this.txt.Text=i.ToString();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
when excuting the line m_de.Invoke("Status",new object[0]);
the application throws a TargeInvocationException
it seems the mothed IIsWebServer.Status can not be found
but I can use "Start"&"Stop" methods
Please help me
|
|
|
|
|
Looking at the IIsWebServer WMI provider class, there is no documented "Status" property. Also, because it's a property, you can't invoke the property but you can invoke the property accessor - try invoking "get_Status" instead (if it existed, which it doesn't seem to). You can also use the Properties property of the DirectoryEntry itself and refer to the property by name (since the returned PropertiesCollection is an IDictionary ). You'll get a PropertyValueCollection and can loop through the values (probably only one for what you want) to get the values.
While there is no documented "Status" property, there is a "ServerState" property that returns an SINT32 (should map to an Int32 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-----
|
|
|
|
|
You are right,man.
I'll just do what you say
|
|
|
|
|
How can I get the "ServerState" property?
I wrote the below
int i=0;
object o=i;
o=m_de.Invoke("Get","ServerState");
But it doesn't work
|
|
|
|
|
Thank you a lot
I've got it
|
|
|
|
|
How can i use data link property dialog in my aaplication i.e i will show this property page to users so that select the data source and test the connection etc. or if some one know any tutorial or any article related to that it will be helpful for me
Thanks
Inam
|
|
|
|
|
Hi Inam
I think you can easily develop your own data link property dialog or you can find some usefull information at the link below.
"
Here is an interesting article from MSDN: http://msdn.microsoft.com/library/en-us/oledb/htm/olpr_core_interfaces_8.asp
"
You can use the "interop technology" to use it in C#(because it use C++)
I hope that is usefull for you.
Good luck!
|
|
|
|
|
Hi Inam
I think you can easily develop your own data link property dialog or you can find some usefull information at the link below.
"
Here is an interesting article from MSDN: http://msdn.microsoft.com/library/en-us/oledb/htm/olpr_core_interfaces_8.asp
"
You can use the "interop technology" to use it in C#(because it use C++)
I hope that it is usefull for you.
Good luck!
|
|
|
|
|
|
|
Hi!
I’m very interesting in when to use exactly the StringBuilder?
For example for something like this?:
String strTest1 = “This”;
String strTest2 = “Test”;
StringBuilder stbTest = new StringBuilder();
stbTest.Append(strTest1). Append(“is a ”). Append(stbTest);
can someone provide some sample codes when to use a StringBuilder?
And can someone tell me his experience about the performance of a StringBuilder?
Regards,
gicio
|
|
|
|
|
StringBuilders should be used where you need to concatenate lots of strings together. The StringBuilder allocates a chunk of memory bigger than the size of the actual string, and copies the new strings into the extra space at the end. This way, you aren't repeatedly re-allocating the memory and copying both the old and the new string into it.
I've found that the StringBuilder takes at least 30x less time than it would take without it. My benchmark test involved loading a rich text file with a picture in it line-by-line. Without the StringBuilder, it took 3 minutes; with the StringBuilder, it took 35ms.
|
|
|
|
|
|
I read somewhere (I don't recall right now) that you should use string.Concat for up to 5 strings and StringBuilder if you need more than 5.
Also, if you really require that absolute last clock-cycle out of string comparisons then the static version of string.Equals yields the quickest returns. But it's horible to read so I just stick with if(string1==string2) ... unless I really need those clock cycles.
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)
|
|
|
|
|
Here's one small fragment:
using System;
using System.Text;
namespace StringVsStringBuilder
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("Playing with String");
string sName = "Jackarse";
sName = "Paul III"; //You actually get a new string (new memory slot).
Console.WriteLine("Before replace (string): " + sName);
sName.Replace("III", "IX");
Console.WriteLine("After replace (string): " + sName);
Console.WriteLine("String.Replace(..) " + sName.Replace("III", "V"));
Console.WriteLine();
Console.WriteLine("Playing with StringBuilder");
StringBuilder sbName = new StringBuilder("Timothy III");
Console.WriteLine("Before replace (StringBuilder): " + sbName);
sbName.Replace("III", "IX");
Console.WriteLine("After replace (StringBuilder): " + sbName);
return;
}
}
}
There're also other things you need to know about String Vs StringBuilder when you do PInvoke. But, one step at a time.
|
|
|
|
|
One of the standards that you need to apply to this decision of string vs. StringBuilder comes when you are looking at how frequently the code gets executed.
If a user clicks a button and that puts out the full name by doing firstName+" "+lastName then you can do the concats quite easily and not even think of a StringBuilder.
If you are constructing a large process that may be executed 10-1000 times per object processed AND you are doing concats in it, then you might get a performance benefit by using StringBuilders. However, you must keep in mind that you can still create process overhead even with a StringBuilder. For example:
StringBuild workArea;
for (int i=0; i<1000; i++)
{
... process
workArea.Append(someString);
...
string answer = workArea.ToString();
}
Once you have set a string to a value of a StringBuilder.ToString() value, you should create a new StringBuilder and cannot use it multiple times.
Another item to consider is if you are doing a looped process and doing alot of checks if either stringA == stringB or stringA == "" then you get the best performance by doing stringA.Equals(stringB) AND stringA.Length == 0.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
how would i retrieve the temperature from my abit ic7-g motherboard? i want to be able to view what the temperature is inside my computer.
thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|
|
Rob Tomson wrote:
how would i retrieve the temperature from my abit ic7-g motherboard? i want to be able to view what the temperature is inside my computer.
You might want to check the Windows Management Instrumentation[^] documentation.
-Nick Parker
DeveloperNotes.com
|
|
|
|
|
i don't see how i can use this to get the temperature. is there an example somewhere? or maybe just point me in the right direction?
thanks,
Rob Tomson
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|