Hello, My question may be very dumb :-( but I couldn't change my web.config using the the following code: XmlDocument doc = new XmlDocument(); doc.XmlResolver = null; doc.Load(@"C:\Web.config"); XmlNode node = doc.SelectSingleNode("/configuration/appSettings"); I don't know why it always returns null. Do you know what I stupidly did wrong? Thanks, Johnny Here is my file
Johny Ng
Posts
-
Failed to edit web.config [modified] -
Question about passport authenticationHey folks, I have to write some C# code to call passport-authenticated web services to verify if some user has the privilege to do that. This is the first time that I work with passport authentication. Could anybody please shed some light where I should start or if possible, some sample code that I should follow? Any help is appreciated. Thanks, Johny
-
How to get IIS application pool identityHi folks, I am trying to use C# to get the IIS application pool identity. I know it's possible to use Vbscript but it seems like there are no equivalent functions, properties in C#. Do you guys know how? Thanks, Johny
-
How to extract services informationI am writing a small program to check some services in W2k3 using C#. It's kind of simple to get the services name as well as their statuses, but I don't know how to get their logon (logon as what account) and recovery information. Anyone knows how to do that? Thanks much, Johnny
-
Regarding SQL DatabaseDon't know why it's hard for you but you can kill active connection by using kill command. Or if you just want to drop that db, simply stop and start SQL server or set that db to single_user mode so all active connections will be killed.
-
Regarding SQL DatabaseConnection is in use or database is in use???Normally, when you want to delete a database, you need to disconnect all current connections.
-
Task Scheduling in c#.netYou mean you want to create a scheduled task using C#? If so just create a process in C# to run Schtask.exe.
-
CounterWell, AFAIK, you can set the IDENTITY_INSERT ON and then let say your max ID is 10 so if you want to set it back to 1, set the seed to -9, and set the seed back to 1.
-
how to use TOP N in c#.net ?Good to know. Thanks
-
how to use TOP N in c#.net ?In Sql server, you can specify "N" dynamically but you have to use dynamic query.
-
Confused about shallow and deep copy in C#Hi folks, I am kind of confused about C# def. about shallow copy. As far as I know, shallow copy points to the same memory location as the orginal, so if we make some changes to the copy, the orginal will be changed. I did a test by doing the followings: ArrayList a=new ArrayList(); a.Add(1); a.Add(2); ArrayList b=(ArrayList)a.Clone() /*C# says it will create a shallow copy here */ b.Add(3); Now a and b are difference, I am confused here. What am I misunderstading? And how to create a true deep and shallow copy in C#? Thanks.
-
Query questionIt will nerver work. Read BOL about GROUP BY first before posting.
-
Query questionNope:suss: something like select * from [table] t where id=(select min(id) from [table] tt where t.company=tt.company) HTH
-
How to align text in C#Hi folks, I want to print out data to the screen in two aligned columns. For example the first column is from 0-20 and the second is from 30-50. It's simple but I don't know how to implement that :). Any idea? Thanks, Tommy.
-
How can I call static method using late bindingHey folks, May be this is a stupid question I am pretty new to C#. I just wonder how can I call a static method using late binding. For example, I have a class with a private constructor and a static method. Is it possible? if yes, then how? Thanks a bunch.
-
How to build a COM+ appI am a newbie in C#. I tried to build a COM+ application by creating an interface like this: public interface ITest { int sum(int x, int y); } then I created a class which inherit from ServicedComponent and this interface. After that I complied and deployed it by using regsvcs. Everything seemed to be fine, but when I checked my COM+ from COM Admin, I not only saw the inferface but also the class methods. It doesn't seems right because normally, only the interface's method should be there. What did I do wrong here? Thanks, Tommy.
-
Modify application pooling of COM+ componentHey folks, I am not very good at C# programming. I want to write a piece of C# code to change the Pool size in Application pooling of a COM+ component? Do you guys know how can I do that. Thanks a bunch. Tommy.
-
How can I get the identity of a application pool?In IIS, to seperate our web app from other, we can create application pools for them. I don't know how can I use C# to get the identity of those application pools? Thanks, Tommy.
-
Check if a user is a member of a local groupHi folks, I want to write a piece of code to check if a domain user is member of a local group in my machine. I've read some articles but I don't think I can use LDAP here. Could you guys give me a hint? Thanks a bunch.
-
List the files in another computerHi folks, I need to write a piece of code that will list all the files in a folder in another machine. Could you guys give me a hint? Thanks.