|
Does any body have idea how to do time scheduled task in c#.Net.
1: Calculating Time Spam Exp: 10 PM - 3AM (How many time spend)
2: If time equal to 10 PM then occure some evet.
Muhamad Waqas Butt
waqasb4all@yahoo.com
|
|
|
|
|
Use a timer (System.Timers.Timer), and check DateTime.Now for time.
public class TimerExample
{
static bool EnableEvent = true;
static TimeSpan ElapsedTime;
static DateTime StartTime = DateTime.Now;
public static void Main()
{
// Create a new Timer with Interval set to 60 seconds.
System.Timers.Timer aTimer = new System.Timers.Timer(60000);
aTimer.Elapsed+=new ElapsedEventHandler(OnTimedEvent);
// Only raise the event the first time Interval elapses.
aTimer.AutoReset = false;
aTimer.Enabled = true;
Console.WriteLine("Press \'q\' to quit the sample.");
while(Console.Read()!='q');
}
// Specify what you want to happen when the event is raised.
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{
ElapsedTime = DateTime.Now - StartTime;
if (DateTime.Now.Hour >= 22 && DateTime.Now.Hour <= 23)
{
if (EnableEvent)
{
ProcessYourEvent();
EnableEvent = false;
}
}
if (DateTime.Now.Hour > 22)
{
EnableEvent = true;
}
}
}
Eduardo Diaz
site | english blog | spanish blog
|
|
|
|
|
Hi All,
I'm doing some research on migrating existing vb6.0 appliation to vb.net. I would like to know what all tools available apart from migrate tool, which come along with .NET IDE, to upgrade vb6.0 application. Any suggestion/ Idea would be appreciated.
Thanks & Regards,
Shiby
|
|
|
|
|
I understad the migration tools are not desired, I understand, I had my share of bad time with the JLCA for Java...
I would assume time is the main concern you have so I have only one suggestion really...
Would you consider wrapping your existing VB methods as business objects to live as a separate tiered COM components and rewriting just your frontend to interact with those objects via COM interfaces?
Disadvantages:
Not REALLY native .Net, but any conversion tool wont give you true powerful usage of .Net capabilities
Advantages:
Quick to develop, n-tier architecture, easier to track bugs, the ability to convert object by object slowly while having your application running
Good luck,
Shimron Shimla
|
|
|
|
|
How can i add a combobox in datagrid and editing the cells
and combobox
haneesh
|
|
|
|
|
Hello,
I am writing a simple program that find a specific user in Active dictory and changes of the the attribute of the user
' constants declaration
Const strADsPath = "LDAP://OU=CRM,OU=Projects,OU=People,OU=Eagan,OU=West-TLRCorp,DC=TLR,DC=Thomson,DC=com"
' database connection
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
strCommand = "<" & strADsPath & ">;(&(objectCategory=person)(objectClass=user)(name=APPCRMDEV_SHARED))" & _
";Name,TLRCustomAttribute1"
objCommand.CommandText = strCommand
Set objRecordSet = objCommand.Execute
Do Until objRecordset.EOF
Set objUser = GetObject(objRecordset.Fields(0))
objRecordSet.MoveNext
Loop
objConnection.Close
the process fails at GetObject and says it 'ActiveX cannot create the component GetObject'. Can anyone help me?
Thank you in advance
|
|
|
|
|
Kamala,
check what you are exactly getting with objRecordset.Fields(0)
print statement or alert to see the value .
that might help you ,
Reason for error could be
1. Zero records
2. Improper Value into GetObject.
let me know if you need help
thanks,
+V
|
|
|
|
|
In VB, I have a two text box, In 1st i have a english data such as Ajit Kumar and i want to change in Hindi language just as Ajit kumar. how i will write the code in VB, & how i will solve this problem.
plz help me .
Your faithfully
Bablu Kumar
mobile no-+919868720551
|
|
|
|
|
You need to work with the globalization class and Culture
Thanks for help
Regards
______________________________
Serge Calderara
MCP(XP & VB.NET)
|
|
|
|
|
My team a currently implementing a system which needs to provide a facility for the user to search for Users or Groups from Active Directory. For the time being we are creating a form for the user to enter criteria which is then used to execute LDAP queries against A/D, with the results being displayed accordingly.
What would be really nice is to be able to utilise the same functionality exposed by DSQUERY.DLL, but I cannot find any resource on the Internet giving examples of this or even the appropriate P/Invoke definitions for this DLL.
So, what I'm after is an article showing;
1) the p/invoke definitions for this DLL (as per the C++ definitions on the MS web site, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ad/ad/icommonquery_openquerywindow.asp),
2) code to open the query window (using OpenQueryWindow),
3) capture and handle the selections.
It may be that the reason I can't find anything is that it is not possible, but I thought I would ask anyway.
Cheers,
Phil
|
|
|
|
|
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.2
|
|
|
|
|
Anybody has an idea on how I can secure the image the so that nobody can open, view and alter it even if it is transfered from one media to another.
|
|
|
|
|
|
for me! *watermarking* is the best solution
start by: http://www.codeproject.com/csharp/steganodotnet2.asp
best regards,
Marcello Cantelmo
www.cantelmosoftware.com
|
|
|
|
|
|
I was wondering if there were code samples out there that helped detect what process is locking a file.
Example: you try to delete a file and it won't let you, it says another process is using this dll. You search through your Services and Task manager, and can't seem to find what process is using that dll. You reboot, and still no luck.
(I came across this with an Oracle dll, and as it turned out some registry key was looking for that dll and kept loading it, but *what* process was loading it is still a mystery.)
Any thoughts?
Thanks
Sue
|
|
|
|
|
|
Holey crap - that looks intense. Thank you very much for pointing me at that article, that's exactly what I needed.
Sue
|
|
|
|
|
I am making an aplication with macromedia Flash & ASP.NET. Flash allows only jpgs to load at runtime, so what i wanna know is a way to upload any image format and convert that to no-progressive jpgs.
Is it possible??
|
|
|
|
|
Hello
all the coders , i want to store the HTML text entered by the user into the table of the DB.When i try to do so, asp.net throghs error, Is there any way in asp.net with C# to encode or decode the HTML tags so that this text can be stored to DB and also can be displayed in HTML formate later on the Browser.
2nd problem is how can i use md5 or other encrytion function using ASP.net with C#?
Waiting for urgent reply. Thanks
|
|
|
|
|
Hi murtaza:
By default, to prevent Cross Site Scripting attacks, ASP.NET disallows HTML tags through QueryString, FormInputs etc. You will encounter HttpRequestValidationException whose message goes like "A potentially dangerous Request.QueryString...".
The solution is that, you can have a ClientSide JavaScript to escape() them and submit to the server where you can UrlDecode the same.
Also for MD5 and other Cryptography algorithms are available in System.Security.Cryptography namespace of .NET Framework BaseClass. However, feel free to check out this article on CodeProject on http://www.codeproject.com/csharp/XCrypt.asp[^].
Deepak Kumar Vasudevan
Personal Web: http://vdeepakkumar.netfirms.com/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
Hi
Deepak Kumar Vasudevan
Thanks, for ur cooperation, it is helpful for me.
|
|
|
|
|
Hi
Coders, I need Urgent help to set the value of the TEXTBOX through JavaSCRIPT.
What i 'm using is document.getElementById(OBJECT NAME).value = value
It is working but just shows the value, does not assign the value to the "VAlue" attribute of the Control permently and when u want to get the set value of the control through any Scripting Language , u could not get any, and when u view the source, No value attribute is set to the Value assigned throgh JavaSCript.
So can any body help me to come out this riddle.
Thanks and urgent REsponse is Required
|
|
|
|
|
Hello, First let me say that I am at best a beginner just learning windows programming. One project which I would like to do and think would not be that hard and could be useful to many of you if you work in IT support that is. The idea I have is that when supporting users, I typically need to remote control their machine which means getting their computer name from them. This can be rather tedious to get this information from a user. What I would like to do is create a client side app that send this information back to a server side app where users are showed waiting in a queue, at that point simply double clicking or righ clicking various support functions could be launched passing the needed information to the utility. For instance take the following list.
Right click ->
Remote Control PC
Remote Regedit
Remote Explore (default C$ share)
Remote Reboot
Remote Message Send
If anyone is interested or can help it would be greatly appreciated.
|
|
|
|
|
Hi All!
RTC API Client can be registered to other SIP servers or not (other than Microsoft Live Communication server)
Please guide me?
Thanks
|
|
|
|