|
Thanks for the reply!
Blackjack got me thinking about it, but I can think of a number of projects (current and proposed) that this could be useful for.
I appreciate your example; it is much more elegant then what I was originally thinking of. Not sure I understand the syntax of “Action[][] _decision” and “private static Action Decision(Int32 dealerShow, Int32 meShow)” but it gives me something to research.
Thanks again!
David Wilkes
|
|
|
|
|
|
I have an application that creates Word documents. I can create and close any number of documents while in the application. But when a document is created in my application and another is created outside of the application, exiting both leave the instance of Word running the task manager.
After some investigation, I noticed that launching Word creates a new instance and obviously an associated PID value shows up in the Task Manager. Launching Word again just adds another handle to the initial Word process, not another instance to the Task Manager; thus the PID has two handles to Word documents.
When you exit one of Word documents, the handle remains (OpusApp?) and is enabled but not visible. Still two handles, but one is visible and the other is not. When the last Word instance is exited, everything is cleaned up, all handles of Word are release, and the process is removed from the process manager.
My problem is this:
I create a word document in my application (new PID)
I go outside the my application and launch Word (i.e. Start Menus->Word)
I now have one entry in the Task Manager (from my application) and the second Word document is attached to it with a new handle.
I close the second Word document, the document closes, but the handle remains enabled, but not visible.
When I close the document I created, Word remains in the Task Manager because I’m checking (application.documents.count) to see if there are anymore instances of word documents out there and there is because this handle is still hanging around in the instance I create even though its not active.
Is there a better way of doing this? Or checking that documents are visible?
Am I just way off base?
Thanks,
Eric
|
|
|
|
|
I had same problem before.
This is what I have to do to close the document and application so the instance won't be in task manager. I am not so sure how you are closing your document.
I close word document programmatically thought.
public void CloseMSWord()
{
msWord.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone;
msDoc.Saved = true;
msDoc.Close(ref msfalse, ref optional, ref optional);
msWord.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone;
msWord.Quit(ref optional,ref optional,ref optional);
msWord = null;
}
Sinc I'm only using word applicatino one at a time, I make sure the Word process is not running in task manager by using following code.
public void KillProcessByName(string processorName)
{
try
{
System.Diagnostics.Process[] p = System.Diagnostics.Process.GetProcessesByName(processorName);
for(int i=0 ;i
|
|
|
|
|
pnpfriend,
Thanks for the reply. I'll give it a try.
Regards,
Eric
|
|
|
|
|
Your image is a bit small, can't tell waht you are pointing out or what you mean.
only two letters away from being an asset
|
|
|
|
|
sorry:
http://img105.imageshack.us/my.php?image=pointerua1.jpg
|
|
|
|
|
Hi
I am trying to get the list of cells that contain Today(), curretPath, filename function.
Following is my code to get the list of all the formulars on the sheet.
formularRange = excelSheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeFormulas,Excel.XlSpecialCellsValue.xlNumbers);
if((bool)formularRange.Cells.HasFormula)
{
System.Array formulars;
if((bool)formularRange.Cells.HasArray)
formulars = (System.Array)formularRange.FormulaArray;
string colname = formularRange.Cells.Name.ToString();
}
Hope this help.
thanks
-- modified at 17:52 Wednesday 30th May, 2007
|
|
|
|
|
Error
------------
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
-------------
i try to use this code
but i have error
***************
using System;
using System.IO;
using System.Net;
using System.Text;
namespace Examples.System.Net
{
public class WebRequestGetExample
{
public static void Main()
{
// Create a request for the URL.
WebRequest request = WebRequest.Create("https://isp.paltel.net/login.cfm");
// If required by the server, set the credentials.
request.PreAuthenticate = true;
request.Credentials = CredentialCache.DefaultCredentials;
// Get the response.
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
// Display the status.
Console.WriteLine(response.StatusDescription);
// Get the stream containing content returned by the server.
Stream dataStream = response.GetResponseStream();
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader(dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd();
// Display the content.
Console.WriteLine(responseFromServer);
// Cleanup the streams and the response.
reader.Close();
dataStream.Close();
response.Close();
Console.Read();
}
}
}
***************
Palestine
|
|
|
|
|
Please don't re-post your question. Did you check out the
HttpWebRequest.ClientCertificates ?
Thanks,
Ben
|
|
|
|
|
Well i want to run a report for a specific record for which i have gotton help from code project but some part the that code gives Error.I am using Visualstudion.Net 2003 C#. the code is
//Instantiate variables
ReportDocument reportDocument = new ReportDocument();
ParameterField paramField = new ParameterField();
ParameterFields paramFields = new ParameterFields();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
//Set instances for input parameter 1 - @vDepartment
paramField.Name = "@vDepartment";
//Below variable can be set to any data present in SalseData table, Department column
paramDiscreteValue.Value = "South";
paramField.CurrentValues.Add(paramDiscreteValue);
//Add the paramField to paramFields
paramFields.Add(paramField);
crystalReportViewer1.ParameterFieldInfo = paramFields;
reportDocument.Load(@"..\..\..\Reports\SalseReport.rpt");
//Load the report by setting the report source
crystalReportViewer1.ReportSource = reportDocument;
the bold instructions are the errors .Actually in VS2003 we don't have obj.Name() and obj.CurrentValues.Add() functions but obj.Set_ParameterName() and Set_ParameterCurrentValues() function. when i used these instead of these,it gave me error saying that function can not be called explicitly or invalid call access operator.
waiting for everyone's solution. thank you
-- modified at 12:46 Saturday 2nd June, 2007
By Lucky Hamad
|
|
|
|
|
Hi!
i want to sort an array containing DateTime of this format: 4/5/2007 8:43:34 PM, in ascending order, i.e. latest date/time on top...
Please give any ideas about this issue...
Thanks in advance...
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Probably a better method exists, you can anyhow try this.
Store the dates in binary format in an ArrayList. Do an ArrayList.Sort() and Arraylist.Reverse(); .
You can store date in binary using .ToBinary(); method and retrieve using DateTime.FromBinary(longDate) method.
|
|
|
|
|
If they are DateTime s then they will sort as stated.
If they are string s, they won't.
|
|
|
|
|
Hi,
since DateTime implements IComparable interface, you can do:
DateTime[] dt...;
Array.Sort(dt);
If it did not implement IComparable (or you want a different order), you would have
to provide a Comparer object as is:
public class DTComparer : IComparer {
public int Compare(object odt1, object odt2) {
DateTime dt1=(DateTime)odt1;
DateTime dt2=(DateTime)odt2;
long diff=dt1.Ticks-dt2.Ticks;
if (diff<0) return -1;
if (diff>0) return 1;
return 0;
}
}
public void demo() {
DateTime[] dt=new DateTime[]{
DateTime.Now.AddDays(1),
DateTime.Now.AddMinutes(1),
DateTime.Now.AddHours(1)
};
log(dt);
Array.Sort(dt, new DTComparer());
log(dt);
}
public void log(DateTime[] dta) {
log("DateTime[]:");
foreach (DateTime dt in dta) log(" "+dt.ToString());
}
|
|
|
|
|
Hello Luc,
It's allways a pleasure reading your explanation!
All the best,
Martin
|
|
|
|
|
|
Luc,
Thanks alot for the help, it solved my problem...
Looking forward for more help from you in future...
cheers!
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
I am in a small project about an application about storing, monitoring and pricing orders. I am completely in charge of the project (from analysis to tests) and I have 3 months in total to complete it (so think of about 1+ month of programming and some more weeks of fixing bugs and adding features during the test period) with 30 hours/week at most.
The company is small. The budget for new technologies is almost inexistent (they will barely afford to increase server's ram from... 128MB(!) and possibly upgrade an old win2000 machine). They want a specialised client fitted to their (quite limited) needs.
I know C# and ASP.NET (not an expert, but I do have experience in various projects). As the users will be few and non-concurrent, ASP.NET was simply not worth the effort (they are not thinking of working over internet).
I could have a simple Access database (back end) and leave to the chief manager a front end with graphs+reports on how to make his own graphs to observe whatever he wants to, and do all the rest of the application in c# clients.
But some advised me of doing everything in Access Forms. I checked this a bit more, and show that possibly Data Access Pages is a better idea. The questions are:
-are Data Access Pages going to be faster in the development? They seem so with their close integration to access, but then i fear that messing with VBScript will slow down the process (I dislike scripting languages)
-is Excel integration (as it will be helpful for pricing) in Data Access Pages strong enough to make up for the lost advanced GUI functionality I can have with WinForms?
In both cases some pretty advanced (think of DataRepeaters on drugs) functionality will be welcome if it's easily implemented.
The back end database could be used with other clients even if the company expands within reason (turning from micro to large is not even in the business plans).
--Victory, Not Vengeance
|
|
|
|
|
Ok, I suppose nobody came up with a reason to use DAP over c# :P
|
|
|
|
|
hello
i use httpwebrequest & httpwebresponse in this page
http://www.codeproject.com/cs/internet/httpeep.asp
i test this code in many site it work verrry good
but when i test this code with this site
https://isp.paltel.net/login.cfm
i have problem ???
please help me plzzzzzz
where the problem and how can solve this problem ????
Palestine
|
|
|
|
|
You don't mention at all what your problem is, so it is kind of hard to know how to help.
Are you getting an error message? An exception?
Ben
|
|
|
|
|
--------------------------------------------------------------------
TrustFailure - The underlying connection was colsed : could not estabilsh trust relashionship for SSL/TLS secure channel
--------------------------------------------------------------------
Palestine
|
|
|
|
|
Ok I missed that the second url was https:.
I haven't actually done this with a Httpwebrequest object, but looking at the documentation it looks like you need to add a client certificate.
Here is the MS help:
An application can add a certificate to a collection, but might not have access rights to it. To use a certificate contained in the collection, the application must have the same access rights as the entity that issued the certificate.
Note
The Framework caches SSL sessions as they are created and attempts to reuse a cached session for a new request, if possible. When attempting to reuse an SSL session, the Framework uses the first element of ClientCertificates (if there is one), or tries to reuse an anonymous sessions if ClientCertificates is empty.
Note
For performance reasons, you shouldn't add a client certificate to a HttpWebRequest unless you know the server will ask for it.
For a code example illustrating how to enumerate the certificates in the client certificate store, see the X509Certificate2Collection class.
Ben
|
|
|
|
|
main problem who can open untrust site with HttpWebRequest ??
Palestine
|
|
|
|