|
This is where you wished you'd remember something absurdly obscure like AsyncStateMachineAttribute.
|
|
|
|
|
B413 wrote: What is the best answer to this question?
If an interviewer thinks there is a best answer to that question then you can be sure that the interviewer doesn't know what they are doing. At best they don't understand the interview process and at worst they are arrogant.
There are of course bad answers to that question - like "what is a class?"
|
|
|
|
|
system.web.ui
system.io
system.data
system.configuration
system.data.sql

|
|
|
|
|
System.web.ui
system.io
system.data
system.data.sqlclient
system.configuration 
|
|
|
|
|
|
Suspicious link is suspicious. And "not an image". Try this one: http://i.imgur.com/NzoGrFa.png[^]
This looks trivial to OCR. That term should get you started.
|
|
|
|
|
The technique you are looking for is Optical Character Recognition. Good luck.
|
|
|
|
|
|
|
thanks in advanced but i have seen this but cannot use it give a lot of error.
do you have and ready example and dll's.
and
Can it convert the sample image of mine to number or not?
|
|
|
|
|
jojoba20 wrote: Can it convert the sample image of mine to number or not?
This is where YOU do the research to find out. Nobody else is going to do YOUR work for you.
The only way to find out is to try it and I don't think anyone is going to do your work for you for free.
|
|
|
|
|
I think Emgu (an openCV wrapper) can do this. Alternatively check out AForge.Net
|
|
|
|
|
Hey there,
can you help me or tell me about your expirience with IPropertySetStorage? I found this by Google and i think this is what i have to use to set custom file properties.
Is there anybody who use this before and can tell me a little bit more about it?
Thanks a lot!
|
|
|
|
|
|
Hi,
I have crrated below windows service and installed it using InstallShield. I am able to see the windows service Started in the Control Panel-Services but I am not getting any email when the minutes turns to 30.
Can anyone help please...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Net.Mail;
namespace MyTestWindowsService
{
public partial class MyTestWindowsService : ServiceBase
{
public MyTestWindowsService()
{
InitializeComponent();
if (!System.Diagnostics.EventLog.SourceExists("MyTestWindowsService"))
{
System.Diagnostics.EventLog.CreateEventSource("MySource", "MyNewLog");
}
eventLog1.Source = "MyEventLogSource";
eventLog1.Log = "MyNewLog Comes here!";
}
protected override void OnStart(string[] args)
{
eventLog1.WriteEntry("In OnStart");
}
protected override void OnStop()
{
eventLog1.WriteEntry("In onStop.");
}
protected override void OnContinue()
{
eventLog1.WriteEntry("In OnContinue.");
}
private void timer1_Tick(object sender, EventArgs e)
{
if (DateTime.Now.Minute == 30)
{
eventLog1.WriteEntry("starting to send email.");
try
{
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
mail.From = new MailAddress("it@mydomain.com");
mail.To.Add("jassim@mydomain.com");
mail.Subject = "Test Mail";
mail.Body = "This is for testing SMTP mail from GMAIL";
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential("it@mydomain.com", "mypassword");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
eventLog1.WriteEntry("email sent.");
}
catch (Exception ex)
{
eventLog1.WriteEntry("failed sending email.");
}
}
}
}
}
Technology News @ www.JassimRahma.com
|
|
|
|
|
What do you see in the logs?
|
|
|
|
|
Application: MyTestWindowsService.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
Stack:
at System.Diagnostics.EventLog.CreateEventSource(System.Diagnostics.EventSourceCreationData)
at MyTestWindowsService.MyTestWindowsService..ctor()
at MyTestWindowsService.Program.Main()
and
Faulting application name: MyTestWindowsService.exe, version: 1.0.0.0, time stamp: 0x53f98df6
Faulting module name: KERNELBASE.dll, version: 6.1.7601.17514, time stamp: 0x4ce7c78c
Exception code: 0xe0434352
Fault offset: 0x000000000000a49d
Faulting process id: 0x390
Faulting application start time: 0x01cfbf77f09ff94c
Faulting application path: C:\Program Files (x86)\My Company Name\My Product Name\MyTestWindowsService.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 2e918d18-2b6b-11e4-8030-50b7c362601a
Technology News @ www.JassimRahma.com
|
|
|
|
|
Let's take a look at that.
Jassim Rahma wrote: The process was terminated due to an unhandled exception. So, there's some exception that caused the application to terminate. The stacktrace shows also on which line this exception occured:
System.Diagnostics.EventLog.CreateEventSource("MySource", "MyNewLog"); Since it is an ArgumentException, we check MSDN[^] for the arguments required and a list of when this exception might be thrown:
- source is an empty string ("") or null.
- logName is not a valid event log name. Event log names must consist of printable characters, and cannot include the characters '*', '?', or '\'.
- logName is not valid for user log creation. The event log names AppEvent, SysEvent, and SecEvent are reserved for system use.
- The log name matches an existing event source name.
- The source name results in a registry key path longer than 254 characters.
- The first 8 characters of logName match the first 8 characters of an existing event log name.
- The source cannot be registered because it already exists on the local computer.
- The source name matches an existing event log name.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
Hi,
I see that names are not consistent:
System.Diagnostics.EventLog.CreateEventSource("MySource", "MyNewLog");
but next line says:
eventLog1.Source = "MyEventLogSource";
probably it should be
eventLog1.Source = "MySource";
if it still does not work,
can also be Logon As permission of the service
(seen via Control Panel ... in service properties on the 2nd tab)
Cheers,
|
|
|
|
|
 I completely removed the eventlog code but still having the same problem!
here is the code after modification:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Net.Mail;
namespace MyTestWindowsService
{
public partial class MyTestWindowsService : ServiceBase
{
public MyTestWindowsService()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
}
protected override void OnStop()
{
}
protected override void OnContinue()
{
}
private void timer1_Tick(object sender, EventArgs e)
{
}
private void timer2_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (DateTime.Now.Minute == 30)
{
try
{
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
mail.From = new MailAddress("it@mydomain.com");
mail.To.Add("jassim@mydomain.com");
mail.Subject = "Test Mail";
mail.Body = "This is for testing SMTP mail from GMAIL";
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential("it@mydomain.com", "mypassword");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
}
catch (Exception ex)
{
}
}
}
}
}
Technology News @ www.JassimRahma.com
|
|
|
|
|
Jassim Rahma wrote: the same problem
Which "same problem" are you talking about? I see several problem with this code.
Your service is started, OnStart is called, seeing that there is nothing in your OnStart method, nothing happens, the method exits, your service exits.
You do not have a timer 1 to use the tick event handler you have setup
You do not have a timer 2 to use the tick event handler you have setup
You would need to set the UseDefaultCredentials property to false
You probably don't have access to network resources depending on the user account your service is running under.
You can lead a developer to CodeProject, but you can't make them think.
The Theory of Gravity was invented for the sole purpose of distracting you from investigating the scientific fact that the Earth sucks.
|
|
|
|
|
Create your event source at install time, not when the service is executed. This is easily done with a couple of registry entries in your installer. See this[^].
|
|
|
|
|
Where do you create / start your "timer"?
|
|
|
|
|
Hi,
I have a C# .NET software and I would like to deploy it with protection. I though many times of the [Product Key] which will be generated from a mix of hardware serials but I saw some applications such as Micros POS using the USB Dongle Protection.
Which one you recommend?
Thanks
Technology News @ www.JassimRahma.com
|
|
|
|