|
Do a search here on this site. There is a very good article on building your own download manager.
|
|
|
|
|
how to embed text to audio wav in C# ? please help me,,, thank you...
|
|
|
|
|
|
Hello.. I need to chatting with Mr.Sergey Alexandrovich for a special important thing..but I don't know what is the way..
|
|
|
|
|
And what has this to do with C#?
|
|
|
|
|
please excuse me I don't know where should I put this question ,so Mr.sergey is active with c# question (for that I put my question in c# section )
|
|
|
|
|
Assuming you have a question ongoing with him, then the correct thing to do is to reply to one of his comments. He will be notified of the reply and he may, or may not, choose to reply to you. If you are wanting to ask a new question, then you should just post a new question and you may get help from him, or you may get help from others who are equally as good, if not better, than him.
|
|
|
|
|
It's pretty easy to get in touch with SA - use the wrong word in a QA question, and he'll be in touch with you pretty quickly...
|
|
|
|
|
|
yes, this is the person.. can you help me please?
|
|
|
|
|
There is no way to chat directly with a member. If they have private email replies switched on for a message in the general forums, you can send a message to them. I will warn you though that this can be seen as incredibly rude - people help out voluntarily and they don't appreciate being approached directly. It's one of the reasons I switched it off - in one week I got nearly 60 requests for help writing projects.
|
|
|
|
|
I posted instructions for you over an hour ago; have you tried it yet?
Veni, vidi, abiit domum
|
|
|
|
|
|
Anas T.P.M wrote: Hello.. I need to chatting with Mr.Sergey Alexandrovich for a special important thing..but I don't know what is the way.. [in Russian accented English] I hear that the snow is falling today in Moscow...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
But the yellow butterfly dons a purple cravat.
|
|
|
|
|
Vladimir!
The usual fee?
The Dalek will sleep with the fishes.
MVVM # - I did it My Way
___________________________________________
Man, you're a god. - walterhevedeich 26/05/2011
.\\axxx
(That's an 'M')
|
|
|
|
|
Nope you can't - not through these forums.
|
|
|
|
|
I need to create excel file and email it once every month. I've got my windows service working. I've got standalone my excel file creation and saving without user prompt working. But when I try to create excel inside windows service, excel file isn't created at all without any error message in the event log. Below is my code. Can someone please enlighten me what goes wrong? Thanks in advance!
private void weeklyTimer_Elapsed(object sender, ElapsedEventArgs e)
{
eventLog1.WriteEntry("W event elapsed @ " + e.SignalTime);
createXLS(dirXLS_W);
}
private void createXLS(string dir)
{
string data = null;
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
object misValue = System.Reflection.Missing.Value;
xlApp = new Excel.Application();
xlApp.DisplayAlerts = false;
xlWorkBook = xlApp.Workbooks.Add(misValue);
xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
eventLog1.WriteEntry("Xls worksheet created.");
xlWorkSheet.Cells[1, 2] = "Date";
try
{
xlWorkBook.SaveAs(dir, Excel.XlFileFormat.xlWorkbookDefault, misValue, misValue, true, false, Excel.XlSaveAsAccessMode.xlNoChange,
Excel.XlSaveConflictResolution.xlLocalSessionChanges, misValue, misValue);
xlWorkBook.Close(true, misValue, misValue);
xlApp.Quit();
eventLog1.WriteEntry("Excel file is saved under " + dir);
}
catch (Exception e)
{
eventLog1.WriteEntry("createXLS error: " + e.ToString());
}
releaseObject(xlWorkSheet);
releaseObject(xlWorkBook);
releaseObject(xlApp);
}
private void releaseObject(object obj)
{
try
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
obj = null;
}
catch (Exception e3)
{
obj = null;
eventLog1.WriteEntry("Exception Occured while releasing object " + e3.ToString());
}
finally
{
GC.Collect();
}
}
|
|
|
|
|
Member 10400691 wrote: without any error message in the event log And what about the debug messages? Are they written to the eventlog?
|
|
|
|
|
My apologies if this sounds trivial but I don't know what it means to write debug messages to eventlog.
All I'm doing currently by brute force is putting eventLog1.WriteEntry at several stages of the code to check where the code stops working, using try and catch block and write exception to eventlog as in my code snippet. Now I've put all my creating excel file code into try and catch like below.
private void createXLS(string dir)
{
eventLog1.WriteEntry("In createXLS");
Excel.Application xlApp;
Excel.Workbook xlWorkBook;
Excel.Worksheet xlWorkSheet;
object misValue = System.Reflection.Missing.Value;
eventLog1.WriteEntry("createXLS declaration");
try
{
xlApp = new Excel.Application();
xlApp.DisplayAlerts = false;
xlWorkBook = xlApp.Workbooks.Add(misValue);
xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
eventLog1.WriteEntry("Xls worksheet created.");
xlWorkSheet.Cells[1, 2] = "Date";
xlWorkBook.SaveAs(dir, Excel.XlFileFormat.xlWorkbookDefault, misValue, misValue, true, false, Excel.XlSaveAsAccessMode.xlNoChange,
Excel.XlSaveConflictResolution.xlLocalSessionChanges, misValue, misValue);
xlWorkBook.Close(true, misValue, misValue);
xlApp.Quit();
eventLog1.WriteEntry("Excel file is saved under " + dir);
releaseObject(xlWorkSheet);
releaseObject(xlWorkBook);
releaseObject(xlApp);
}
catch(Exception e1)
{
eventLog1.WriteEntry("createXLS error 1: " + e1.ToString());
}
}
And this is the error I get. Line 218 is at
xlApp = new Excel.Application();
createXLS error 1: System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with
CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed
Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).
at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)
at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType)
at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at UPNP_WS_Weekly.UpnpWeeklyMailService.createXLS(String dir) in c:\Users\SolarGy\Documents\Visual Studio 2013\Projects\UPNP_WS_Weekly\UPNP_WS_Weekly\Service1.cs:line 218
|
|
|
|
|
So what is the code on line 218?
Also write the dir to the log to make sure it is valid
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
line 218 is at
xlApp = new Excel.Application();
|
|
|
|
|
Written the dir to the log. It is a valid directory.
|
|
|
|
|
The problem sounds to me like an issue with the account that you are running the service under doesn't have access to the appropriate part of the registry. To test this out, set your service to run as a named user and then see if it works.
Note, I wouldn't recommend this as a permanent solution. Instead, I'd have the system admins create a dedicated locked down user for this service to run under.
|
|
|
|
|
This windows service may be running under a different user.
This user may not have access rights to the file.
|
|
|
|