|
I want to program to check when a site or web server or mail server is down or up and save these informtion in a database.
How could I check these web servers?!
|
|
|
|
|
Nafiseh Salmani wrote: How could I check these web servers?!
Look at this[^]
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
thanks for the answer but is not what I ask exactly!!
I want to write a C#.net code to check web servers and mail servers automatically !!
|
|
|
|
|
Nafiseh Salmani wrote: I want to write a C#.net code to check web servers
The article suggest you the different ways. You can use of them to write your C# code.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
System.ServiceProcess contains all you need.
You can construct ServiceController with service name and then check Status property.
Edit: Thats in 3.5 framework.
|
|
|
|
|
Hi, I have the following issue in C# 2, can someone point me in the correct direction please?
I need to instantiate a combobox object (one for each column in my DevExpress grid control). At design time, I have no idea how many columns the grid will have so I need to iterate through each in a loop. Each combobox will need to have a different name e.g. col.FieldName + "ComboBox". However, I can't get the syntax correct.
Current Code...
string ComboBoxName = "";
foreach (GridColumn col in view.VisibleColumns)
{
ComboBoxName = col.FieldName + "ComboBox";
RepositoryItemComboBox ComboBoxName = new RepositoryItemComboBox(); // Fails on this line as compiler says I'm attempting to redefine the ComboBoxName object //
}
Any suggestions?
Thanks
|
|
|
|
|
Hi,
In your code, you have the same name (ComboBoxName) for a string and for a RepositoryItemComboBox, which is unacceptable.
you are confusing two concepts:
1. each Control has a Name property, that is a string that is available at run-time, so you could find a Control "by name" just by iterating over tham all and recognizing the Name. Ir is primarily used by Visual Designer. If you don't use Designer, you may not need to assign a value to Name at all.
2. each Control may (or may not) have a reference stored in a variable, obviously a variable has a name. Controls don't need to have public variables refering to them, as soon as they are added to the Controls property of a Container (say a Form), they become part of that Container.
I will assume you are not really interested in the Name property, and want to hold references to a variable number of RepositoryItemComboBox objects. This would work for you then:
List< RepositoryItemComboBox> myRICBlist=new List< RepositoryItemComboBox>();
foreach (GridColumn col in view.VisibleColumns) {
RepositoryItemComboBox comboBox = new RepositoryItemComboBox();
myRICBlist.Add(comboBox);
}
and later on you could iterate all those comboboxes with:
foreach (RepositoryItemComboBox comboBox in myRICBlist) {
comboBox.Clear();
}
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Perfect, Thanks Luc.
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
I need to use search engine like www.alibaba.com via my code! Is there any way to send a query or parameters through my C#.net code to this or any other search engines?!!
|
|
|
|
|
Nafiseh Salmani wrote: I need to use search engine like www.alibaba.com via my code! Is there any way to send a query or parameters through my C#.net code to this or any other search engines?!!
Yes, probably, maybe. Depends on the search engine.
|
|
|
|
|
|
Well the first step would be to learn how a specific engine needs to receive the parameters, this is called "requirements".
Now I say that would be the first step for someone that is capable of developing the software to those requirements, otherwise the first step would be to learn a whole bunch of other things that a developer would have to know to do this project.
|
|
|
|
|
Hi all,
I would like in C# to initialize a thread with a delegate. It looks like this :
<br />
internal delegate void MyDelegateType();<br />
internal MyDelegateType MyDelegate;<br />
<br />
public Init_Launch_Thread()<br />
{<br />
Thread lThread_Groupe = new Thread(MyDelegate);
lThread_Groupe.Start();<br />
}<br />
It is not allowed and I do not really get why. My problem is that I do not know before construction of my class what actually will be launched in the thread. Is anyone got an idea ? I would like to avoid polymorphism there for other reasons.
thx
|
|
|
|
|
Personally, I would read the documentation of Thread and ThreadStart.
And then I would use the Thread pool instead.
|
|
|
|
|
I'm not sure I understand. Your MyDelegateType has the same signature as the Framework's ThreadStart delegate
If the signature of your thread's method is changing, maybe using a lambda would help:
new Thread( _ => ThreadMain( ... parameters ... ) );
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Thanks for your answers, I'll have a look at it
|
|
|
|
|
Hello people, My client wants to have an app which will automatically download excel 2003 attachments from emails and store it into the database.
At the moment I have designed an app in C# which reads excel sheet by browsing to it from the local machine and then displays contents into the GUI.
Is there any way in which I can automate this process..
Cheers!
|
|
|
|
|
Here's A POP3 Client in C# .NET[^] a good link to get you started on the emails. look at the last codeblock for attachment retrieval.
If it' stuck, DO NOT pull harder!
|
|
|
|
|
If you're using Outlook you could write a small add-in and hook onto the mail received event. This would then start a process to check the received message, check for attachments and do any further processing required.
I assume you're talking about holding the actual file in the database - it might be a better idea to save the files on a drive and write a reference to the path in a table somewhere.
It definitely isn't definatley
|
|
|
|
|
Yea am using outlook 2003 to receive emails from clients. The emails contain the Excel sheet with a fixed format. Could u elaborate on how it would be possible to write a reference to Outlook using C#, so that application click even can check for new attachments and download it.
|
|
|
|
|
It's a couple of years since I've done this and don't appear to have anything directly relevant to hand. However, you'll be best doing some research into Visual Studio Tools for Office (VSTO - there's some good articles here[^]) as well as the Outlook object model (try here[^]).
In summary, you'll create an Add-in for Outlook using VSTO. This add-in will register as a listener with the NewMailEx event (mail received) and once the event is fired, the add-in will examine the new mail to determine whether or not is has any attachments and if any of these are excel documents.
From here the rest of your task should be fairly trivial; either you'll copy the file to a folder somewhere and execute a stored procedure to write an entry into a database table somewhere or you'll stream the file directly into the database (depending on what method of storage you use).
A quick google will bring up a stack of articles; I remember in the past having some trouble deploying Office 2003 add-ins but think they were mostly resolved by ensuring that VSTO was installed on the client machine (free download from MS[^])
Sorry I don't have anything more specific but with a little bit of research you should be able to find your way.
HTH
It definitely isn't definatley
|
|
|
|
|
I've just re-read this; it sound like you're wanted to copy the contents of the excel file into a database table. If you know that the format of the file is going to be identical each time, I'd suggest creating a DTS package using integration services and executing this, passing in the name of the file as a variable. If it's not identical you might struggle - it's non-trivial at any rate.
It definitely isn't definatley
|
|
|
|
|
The name of the Excel File varies, but the sheet has fixed columns & column names. Data appearing in the column varies.
|
|
|
|
|
In which case you should be able to build a simple DTS package and execute it from within the add-in. I've not really got enough room to explain here but there's plenty of articles and the SSIS newsgroups have some pretty comprehensive examples.
It definitely isn't definatley
|
|
|
|