|
The problem i am running it the application in thread and using a singlton and factory pattern too and it is a demon thread and dont have to do any thing with any web form i have at the end passed the page reference who calls the thread but when in the class file after the thread has been created and i try to bind the results with the datagrid it raise the exception that request is null
|
|
|
|
|
Hi.
I want to create a C# program that will be able to write in a text file every application that the user/machine ran. This file will resides in a specified directory on a particular machine. I have read that this is possible using WMI in a client-server environment. I am running Active Directory using Windows .Net Server RC1. I don't have any experience with WMI yet. Is WMI supported in C#? What is the namespace where I can find the classes specific to WMI? I would greatly appreciate it if someone can show to the basic program structure for this or links relevant to this matter. Thanks
|
|
|
|
|
swarm wrote:
Is WMI supported in C#?
Yes.
swarm wrote:
What is the namespace where I can find the classes specific to WMI?
System.Management
You can find very good articles about WMI in C# in this site.Search this site with WMI or System.Management Keyword.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I need to be able to call a .NET object from inside ASP (and later VB6).
Has anyone got information on this?
Simon
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
my svg article
|
|
|
|
|
put this attribute on the class:
[System.Runtime.Interop.Guid("put-a-guid-here")]
Set "True" on Project properties/Configuration Properties/Build/Register for COM Interop
That's it.
I see dumb people
|
|
|
|
|
SimonS wrote:
Has anyone got information on this?
Simon, I believe you are going to need to look into the Regasm.exe (Assembly Registration Tool)[^] to do something like this. I haven't been able to spend a lot of time with it, however I am looking to do this as well. You might also find the Tlbexp.exe (Type Library Exporter)[^] helpful in this process. Let me know if this helps.
Nick Parker
You see the Standards change. - Fellow co-worker
|
|
|
|
|
|
Hi there,
I need some basic WinXP icons as Refresh, Open, Print etcetera.
Where can I find them?
Thanx in advance
Tom
|
|
|
|
|
Email me and I'll send you some via email, I can't find you email in your profile
|
|
|
|
|
can you possibly send me some basic win xp icons too ? email them too cuteone_97058@yahoo.com
jesse m
|
|
|
|
|
|
I send a email from a C# form.
Example below.
using System.Web;
using System.Web.Mail;
try
{
MailMessage MailMsg = new MailMessage();
MailMsg.From = "dorina@tradelabs.ro";
MailMsg.To = "dorina@tradelabs.ro";
MailMsg.Subject = "test";
MailMsg.Attachments.Add(new MailAttachment("C:\\Test\\Noutatile saptamana.htm"));
SmtpMail.SmtpServer = "name of server";
SmtpMail.Send(MailMsg);
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
It works.
BUT when Attachment file name containts ASCII extended characters
(example MailMsg.Attachments.Add(new MailAttachment("C:\\Test\\Noutaţile săptămână.htm"));)
then the mail can't be send and I get a "Could not access 'CDO.Message' object." exception.
How can be solve this problem?
Thanks, Dorina
dorina
|
|
|
|
|
Hello,
How do I do to an application when minimized flash in taskbar ?
Thanks for your help.
|
|
|
|
|
The API you should look at is Flash or FlashEx.
Here[^]'s an article on how to use the API.
Here[^]'s an article from EricG on using libraries from .NET generally.
HTH
Cheers,
Simon
"The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter.
my svg article
|
|
|
|
|
Does anyone know if c# has an Idle event that is called continuously while the application is in an idle state?
The Application.Idle event occurs when the application finishes processing and is about to enter the idle state.
I need one that will be called repeatedly...
|
|
|
|
|
Can any one tell me how to get to the selected text in an edit/richedit control (or any control having text that could be highlighted) of a foreground window from my own application? What about accessing a selected text in IE browser? One can see such use in Microsoft Boolshelf -- highlight any word in any window and then click on the QuickShelf icon in the system tray to get the meaning of the word! Tomasz Sowinski in the VC++ message board mentioned earlier using a combination of (1) calling the WIN32 API GETFOREGROUNDWINDOW to get a handle to the window and (2) sending the EM_GETSEL window message to get a pointer to the selected text. But this limits only the case when the foreground window is itself a edit/richedit control.
Would appreciate very much any answers to these questions!
Gene Yu - gene4yu@yahoo.com
|
|
|
|
|
I am attempting to create a piece of code that will drop through from a root directory and list all files and subdirectories within it (regardless of the directory depth)
As I see it the only way I can do this is through some sort of recursive code, which at the moment elludes me, has anybody come across anything like this before?
At the moment I have the following, which is butt-ugly and doesnt come close to what I need :
<br />
public string ARCHIVE_PATH = ".\\archive\\";<br />
private void RecurseDirectories()<br />
{<br />
listBox1.Items.Clear();<br />
DirectoryInfo dir = new DirectoryInfo(ARCHIVE_PATH);<br />
DirectoryInfo[] diArr = dir.GetDirectories();<br />
foreach (DirectoryInfo dri in diArr)<br />
{<br />
listBox1.Items.Add(dri.Name);<br />
DirectoryInfo drill_dir = new DirectoryInfo(ARCHIVE_PATH + dri.Name);<br />
DirectoryInfo[] drill_diArr = drill_dir.GetDirectories();<br />
<br />
foreach (DirectoryInfo drill_dri in drill_diArr)<br />
{<br />
listBox1.Items.Add(drill_dri.Name);<br />
}<br />
} <br />
}
|
|
|
|
|
|
|
Hi,
I wonder if there is an equivalent to __DATE__ and __TIME__ in c#?
I just want to show the compilation date/time in an about box.
Martin Leonhartsberger
mleonhartsberger@a1.net
|
|
|
|
|
Not sure how, but attributes may hold the answer
Sorry, couldn't be more vague if I tried, but its worth a shot.
--
Paul
"If you can keep your head when all around you have lost theirs, then you probably haven't understood the seriousness of the situation."
- David Brent, from "The Office"
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
Can you please explain a little what you exactly mean with "attributes" ?
Martin Leonhartsberger
mleonhartsberger@a1.net
|
|
|
|
|
Attributes are a way to add bits to the metadata for types. For example, when you're developing an ASP.NET Web Service you use the attribute [WebMethod] to effectively mark it to be used.
So, you could develop a class like so (taken from code by Jeff Prosise):
[AttributeUsage (AttributeTargets.All, AllowMultiple=false)]
class BuildDateAttribute : Attribute
{
public string BuildTime;
public string BuildDate;
public BuildDateAttribute (string BuildDate, string BuildTime)
{
this.BuildDate = BuildDate;
this.BuildTime = BuildTime;
}
}
This allows you to include a BuildDateAttribute to the metadata (the example this is taken from is for code revisions). I'm not sure, but you may be able to include code to automatically determine the date and time.
Then you can use it as follows:
[BuildDate ("12:01","13/03/2002")]
class TestClass
{
.
}
Then you can obtain the metadata as follows:
MemberInfo info = typeof(TestClass);
object[] attributes = info.GetCustomAttributes(false);
if (attributes.Length > 0)
Console.WriteLine( attribute.BuildDate );
I've not tried the code myself but it ought to work. If you do give it a go and get it to automatically insert the current time at build then it'd be great to put as an article on CP (in my opinion).
Hope that helps, let me know how it goes.
--
Paul
"If you can keep your head when all around you have lost theirs, then you probably haven't understood the seriousness of the situation."
- David Brent, from "The Office"
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
There isn't anything built into the framework to get that information, but there is a formula used to create the build and revision version numbers for the the assembly. Unfortunately this means that in order to make use of this you have to let those be generated, which can be a pain in the ass if you give them a strong name.
I don't remember what the formula is, but if you check the DOTNET list archives around the last week of December 2001 and first week of January 2002 someone mentions it in reference to decoding when the 1.0 framework assemblies were built.
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
James T. Johnson wrote:
I don't remember what the formula is, but if you check the DOTNET list archives around the last week of December 2001 and first week of January 2002 someone mentions it in reference to decoding when the 1.0 framework assemblies were built.
How do you manage to remember that type of stuff James? Don't you have anything better to do? Weren't you working on a book with Tom and Nish? What about school?
Seriously man, get a life!
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
Microsoft has reinvented the wheel, this time they made it round.
-Peterchen on VS.NET
|
|
|
|