|
The application event log of the first computer (where the program is written) or the application event log of the second computer (where the installation package is installed) ?
Yes there are events logged in application event log in both computers. They are logged at the correct time interval. Then why are not emails sent out from the second computer? I have provided all necessary gmail smtp credentials. Emails are sent out if I run the service on the first computer
STS
|
|
|
|
|
Member 10400691 wrote: The application event log of the first computer (where the program is written)
or the application event log of the second computer (where the installation
package is installed) ?
You're kidding me, right?? Why would you look for bad log entries on the machine where it works??
Alter the code in your service to write everything it's doing to the Application Eventlog, from OnStart on.
|
|
|
|
|
Dave Kreskowiak wrote: You're kidding me, right??
Exactly my thought when I read that.
|
|
|
|
|
Member 10400691 wrote: but no emails is sent How do you send emails? Via an external mail provider like google mail? Did you configure that mail account correctly? Has your service access to the network?
|
|
|
|
|
Yes via google mail! Yes I configured that correctly. Emails are sent when I run the service from my first computer (where the service is written). They are not sent on my second computer (where the installation package is installed). The 2nd computer is connected to the network.
STS
|
|
|
|
|
For the purpose of diagnosis, also try running the service with a different Windows account - an account which can send email via common email clients.
|
|
|
|
|
Member 10400691 wrote: Hope someone can help!
For starters it appears that this has nothing to do with installation even though you spent a bit of time explaining about installing it.
If the install failed then either the service wouldn't appear at all or the service would not start.
It appears that the service is in fact starting. So that means there is some problem which has nothing to do with the install. If you were missing a dependent dll then the service would be unlikely to work.
What is probably happening is that either your code is not even attempting to send the email or it does and fails. And of course you don't have any code that would even give you a hint as to what that is. The way to solve that is to add logging.
Doing that allows you to solve problems going forward.
The alternative is to
- Build a debug version of the service
- Install it
- Install VS
- Attach to the running service
- Step through it.
As noted in another thread one reason could be permissions. The service ALWAYS runs as a user. So which user does it run on the first computer? Which on the second? It could be the firewall preventing the email code from connecting to the email server. If you were collecting and reporting (logging) errors then this would be obvious immediately.
|
|
|
|
|
I have written the below code to capture data from Panasonic PBX(KX-TDE 100/200) and write it to a file. When I try to run the below code, it shows "not responding" in the Task Manager.
Also I tried to debug where might be the problem.The line
Socket socket = listener.Accept(); will be hit while debugging and after that it shows "Not Responding".
The PBX is connected to LAN in my company.Any configurations need to be done on my LAN?
I tried the same code for IP:127.0.0.1 to send a string to client app and it worked.But when I tried to pull data from PBX, its not working.
The LAN wire from my PBX is connected to the switch.
Please let me know what mistake I am doing. Also point me to good samples on capturing data from PBX using C#.
private void btnstartserver_Click(object sender, EventArgs e)
{
int portno = Convert.ToInt32(txtportnum.Text);
byte[] receivedBytes = new byte[1024];
IPHostEntry ipHost = Dns.GetHostEntry(Dns.GetHostName());
IPAddress ipAddress = ipHost.AddressList[0];
IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, portno);
txtboxstatus.Text = "Creating socket object...";
Socket listener = new Socket(AddressFamily.InterNetworkV6,
SocketType.Stream,
ProtocolType.Tcp);
listener.Bind(ipEndPoint);
listener.Listen(10);
txtboxstatus.AppendText("Listening on " + ipHost.AddressList[0].ToString() + ":" + portno.ToString() + "\r\n");
Socket socket = listener.Accept();
txtboxstatus.AppendText ( "\n Connected with ..." + ipEndPoint.Port);
string receivedvalue = string.Empty;
receivedvalue = ReadMessage(socket);
txtboxstatus.AppendText("\n Message read.....trying to write to the file...");
try
{
FileStream fs = new FileStream("E:/Demo/IpData/Call.txt", FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
sw.Write(receivedvalue);
sw.Dispose();
fs.Dispose();
}
catch (Exception ex)
{
txtclient.AppendText(ex.Message);
}
}
Even I tried to use BeginAccept(.....), but in vain.
Thanks,
DotNetTide
|
|
|
|
|
I have a feeling that you are doing this the wrong way round. Are you sure the PBX is trying to do a connect to your server code?
Veni, vidi, abiit domum
|
|
|
|
|
No the PBX is not trying to make a connect. Even I am new to this socket programming, this is what I got as basic info from my peers in my company who are already working on sockets and PBX.
Please point me to a link or provide me a sample for connecting to PBX as client and fetching data from it. I also tried to connect to PBX by writing a client app and considering PBX as server.Even then I was unable to connect.
|
|
|
|
|
Arjun Mourya wrote: I got as basic info from my peers in my company who are already working on sockets and PBX. Then you need to talk to them and find out what address and port you need to connect to, and what special protocol exchange you need to use.
And your code needs to be written as a client application, not a server. Sample code for this can easily be found via Google.
Veni, vidi, abiit domum
|
|
|
|
|
I know the port number,address and protocol. I was able to make connection to the PBX by writing client application. But I did not receive any data apart from "\r-'. Any idea on how to proceed further?
|
|
|
|
|
Arjun Mourya wrote: Any idea on how to proceed further Yes, get hold of the documentation for the PBX and find out what commands and responses it uses.
Veni, vidi, abiit domum
|
|
|
|
|
You've written a TCP/IP based server. Well, the PBX is not a client and it's not going to seek out your server and connect to it. Sorry, but the code you've written is all for nothing.
The PBX is the server and you have to write the client portion.
|
|
|
|
|
I tried to connect to PBX by writing a client app and considering PBX as server.But even then I was not able to make a connection with PBX.Please point me to a link or provide me a sample.Also do we need to provide valid credentials while making a connectio to PBX?????
|
|
|
|
|
First things first. Does the PBX even support this? Which kind of server does the PBX expose? How do you have to connect to it?? What port does is it listening on?? This is all covered in the documentation on your PBX system.
What works for one PBX may not work for another. You start with the documentation on your system, not some piece of "sample" code.
|
|
|
|
|
I was able to make a connection to PBX but did not receive any data.I only received "\r-" as "13 45" in a byte array. I also made some test calls from an extension so that I can pull some data from PBX. I guess that I need to supply credentials to PBX to fetch data. Any idea on how the username and password string should be framed to be send to PBX.
|
|
|
|
|
Why do you think anyone here would know anything about your PBX system? AGAIN, this is what the documentation on the system is for!
|
|
|
|
|
Hi,
I'm having a trouble with a query SQLite with C#. I have two different datetimepickers on my windows forms app and when I try to get some data between two dates, it shows some stuff that I don't need or nothing without any errors.. I tried all the ways but nothing changed. Could you please suggest some things me to do?..
Thanks & Best Regards
Fatih BURAL
|
|
|
|
|
What type is the database-column? Is it a datetime, or a text-type? How does your query look? Are you sure the datetime-values are parsed correctly?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Sounds like you have an issue with differences in cultures. In other words, the data that you are retrieving is stored as one date culture, and the UI is using a different date culture.
|
|
|
|
|
Be careful - the value retrieved from the DateTimePicker may contain a Time also - remove that before you enter the value into your query.
|
|
|
|
|
Hi friends!
Thanks for your messages. My query down below;
"SELECT COMPANY_NAME,PRODUCT_NAME,P_STATUS,IMPORT_DATE WHERE IMPORT_DATE BETWEEN '" + dateTimePicker1.Value.ToString() + "' AND '" + dateTimePicker2.Value.ToString() + "' "
Database column is a datetime so is datetimepicker value. There are no errors but it shows only one date. I checked data types many times but what is wrong with this query?
|
|
|
|
|
Pete already pointed out that there might be a preblem with different formats (e.g. due to different cultures). Avoid that problem by using a parameterized query.
And as I told you above, remove the Time component of the value. dateTimePicker1.Value.Date will help you (and no: do not add a ToString()!).
|
|
|
|
|
I have done everything you said but it didn't work. So is there any other way to solve that problem? My new query that didn't work down below;
"SELECT COMPANY_NAME,PRODUCT_NAME,P_STATUS,IMPORT_DATE WHERE IMPORT_DATE BETWEEN '" + dateTimePicker1.Value.Date + "' AND '" + dateTimePicker2.Value.Date + "' "
Thanks & Best Regards For Your Support..
|
|
|
|