|
I'm trying to trigger a hibernate event in Windows Service in
DotNet 2.0.But surprisingly it seems it can't when Windows goes into the hibernate state.Is there an approach to do this.
Any help will be appreciated!
|
|
|
|
|
First let me say that I have no experience with hibernate events so what I am about to say is all theoretical "what if".
Hibernate events are all about user sessions. Services are not about user sessions and therefore it may no make sense to be concerned with them from a pure definition of services. That is my first thought or theory regarding your stated problem. As I said that could be completely wrong.
That said there a many implementations of Services that, on occasion, require User Session consideration(s).
In general Best Practice for that situation is to add a User Session process to your system. This is most often done in the form of a System Tray Process but does not need to be. Then you can use an appropriate (for your requirements) form of IPC to communicate between the two processes.
|
|
|
|
|
Very Welcome to my Question.
I want to use sqlite database engine...
I am having dll file of System.data.sqlite.dll
I have added reference of this file to myapplication.
I want to install or register it to the my Global assembly cache..
When i try to install or compile my System.data.sqlite.dll assembly it
shows error "Invalid Assembly file"
Is anything else required to sqlite Use Database engine ?? ??
Thank in advance.
|
|
|
|
|
Is it signed? Assemblies in GAC must be signed with key (hash), so they are unique (name + version + hash).
|
|
|
|
|
I'am developing an application that works similar to web browser.
A browser first downloads HTML, and having read this single file it downloads files that are pointed in this HTML file. This causes that many requests to the same server may be performed (alongside with requests to other web servers , but it is irrelevant here)
I assume that web browsers generally do not open new TCP connection to the web server for each file they need to download. Instead (if all resources are located on the same web server) a single connection is established, and this TCP endpoint is used for all subsequent files retrieved using HTTP protocol. (A browser might also want to multi-thread the whole-download operation, however it is not the case that there are created as many threads (and each with its own TCP connection) as resources to be downloaded).
The first question is: is the above assumption true ?
If it is true, the second question is:
How am i supposed to achieve reusing TCP connection when using HttpWebRequest / HttpWebResponse ?
in other words: how to avoid establishing a new TCP connection (for each file to be downloaded) when downloading many small files from this server. The signatures of WebRequest do not expose anything that I might assume to be usefull in this very scenario (many files to download).
And the third question is: maybe these classes are already smart enough to cache TCP connection for some time in order to optimize the whole process (internally reuse existing TCP connections) ?
thanks for help
Michal
|
|
|
|
|
ok, I've learned that underneath TCP connections are reused whenever possible.
Thanks,
Michal
|
|
|
|
|
Hello all,
I need help to create a crontab(like in unix) type scheduler to schedule a web page (asp.net c#) in windows XP.
I want some web pages to call on some particular day on particular time.
Is it possible in asp.net?
Can any one help me to do this feature.
Thanks in advance!
Asif
|
|
|
|
|
|
I don't know how to pass data from a child thread to the parent thread. I want to write a child thread that is reading data from a serial port and passes the data to the parent thread that updates a TextBox. I think I have to use callback with delegates, but I don't know how to do that. Does anybody have a code sample in C#.NET or C++.NET? If would be very grateful if somebody could help me.
|
|
|
|
|
vikingsimon wrote: Does anybody have a code sample
Yes, tons of people have posted code samples of delegates and threading, pretty much everything you need as far as I can tell from your post. They have posted them here in articles on CodeProject and in many, many other places on the interent. I have no doubt that microsoft has posted them in their documentation as well.
In my experience I have found that using Google can be very helpful at finding such things.
Good luck.
|
|
|
|
|
Also take a peek at the SynchronisationContext class. The documentation is good.
|
|
|
|
|
Dear all;
Recently our organization needs to convert a 3rd party’s MFC class library into managed code for usage in .NET. In the SDK, there is a header file and a dll library.
I only have little knowledge on wrapping unmanaged code to managed code. I would much appreciate if any one could give advice on how to implement.
Below shows the code in the header file for the dll library. I am quite confused on how to deal with the nested class and callback functions.
////////////////////////////Header File///////////////////////////////////////////////////////
#pragma once
#ifdef UNMANAGEDCODE_API_EXPORTS
#define UNMANAGEDCODE_API __declspec(dllexport)
#else
#define UNMANAGEDCODE_API __declspec(dllimport)
#endif
#include <sys/timeb.h>
class UNMANAGEDCODE_API MainClass
{
public:
MainClass ();
Virtual ~MainClass ();
Virtual bool StartUp(const TCHAR* pcszConfigFileName = NULL);
class NestedClass1
{
public:
// This is the entry for call back function
virtual bool OnNestedClass1() = 0;
};
Bool SetCallback(NestedClass1* callback); typedef struct NestedSruct1
{
unsigned int unId;
__timeb64 createTime;
}NestedStruct1;
const NestedStruct1** GetData(unsigned int& unCount);
};
|
|
|
|
|
I have developed an AxctiveX as COM object
As there noone know how to realize new ISiteLock interface in C# I want to know is there a way to get URL of a page from ActtiveX?
Thanks
|
|
|
|
|
hi i needed to accept amharic string from user with out turning on the visual geez software in vb.net. i tried so many techniques but none of them work. if anyone have dealt with this issue please help me??? thanku
|
|
|
|
|
change your programing language to c++ and I will tell you there answer
|
|
|
|
|
Hi,
I am using Entity framework in a dynamic data web app with C#.
So far I have created a source file with partial declarations of my entity classes on which I have set attributes like ScaffoldTable.
I did that in order to not lose this code in case of regeneration of the entity classes.
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace AdmissionForm
{
[ScaffoldTable(true)]
public partial class AdmissionForm
{
}
...
}
I would like to know if there is a way to add attributes to the properties defined in this entity classes from the source file I have added.
Regards.
|
|
|
|
|
|
Hi,
I want to develop a service in C# ,that will run on the exchange server. The service will monitor a particular email account whenever send/receive happens the service will forward the arrived mail to a specified email id.
Kindly guide me through this.
Thanks
|
|
|
|
|
deepak_int wrote: I want to develop a service in C# ,that will run on the exchange server. The service will monitor a particular email account whenever send/receive happens the service will forward the arrived mail to a specified email id.
Yes, you can do it using EWS(Exchange Web service)
Exchange Server 2007 provides Web Service (EWS), you have to use those web methods to read and forward those mail.
Brij has already written some nice article on that Exchange Server Web Service Article[^]
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
thanks for ur suggestion Abhijit.
|
|
|
|
|
OK, this may be a somewhat dumb question but I haven't found a definitive answer yet so I thought I'd try here.
I currently have a client/server WinForms app developed using .NET 3.5 framework. So all my users have .NET 3.5 installed on their PCs along with the application.
I would like to install .NET 3.5 SP1 on my development machine, basically since it's supposed to solve a lot of performance issues with VS2008. However, do I need to have all the users upgrade to .NET 3.5 SP1 as well? That will be a major effort that I don't want to do at this time. So if I'm required to re-deploy .NET 3.5 SP1 to all users in order to run an application developed using SP1, I'll hold off with upgrading my development machine, otherwise I'll press.
Thanks in advance... Steve
|
|
|
|
|
PSU Steve wrote: I haven't found a definitive answer yet
Short of just saying "yes it's required", isn't that up to you to answer? I mean you know what your app does, what it uses in the .NET framework, no one else does. So since Microsoft has documented SP1[^], isn't it up to you to figure that out rather than expecting to find a definitive answer from someone else?
|
|
|
|
|
I was really hoping for a little assistance as most people here at CP are helpful versus just sarcastic...
That said, I guess what I am really asking is this... If I (A) install .NET 3.5 SP1 on my development machine to take advantage of the supposed VS2008 performance fixes, (B) recompile my application "as-is" (ie making no changes specific to anything in SP1), and (C) deploy the app to my users who still have the "basic" .NET 3.5 framework, will it work?
Thanks... Steve
|
|
|
|
|
From my experience, yes it will work, but sp1 adds few functions, if you ship program that uses one of those, it will work as long as this function won't be executed. When it does, exception will be thrown (missing function). I don't know how much of this is help, cause I can't prove it will work the same way everywhere.
But after my app crashed once, I ordered my client to download update and don't whine :P.
|
|
|
|
|
Ravadre wrote: From my experience, yes it will work, but sp1 adds few functions, if you ship program that uses one of those, it will work as long as this function won't be executed.
Are there any automated programs that can take an .exe and determine whether it references any functions that don't exist in particular versions of .net? To be sure, it would be possible for a program that references a function only found in a later .net version to work with earlier ones if the function is never actually executed, but outside of code specifically written to handle different versions of .net (e.g. try using the new version of a function and set a flag based upon whether it works; if it doesn't work, use the old one instead) I would think the list of functions referenced would correspond strongly to the list of functions required.
|
|
|
|