|
thanks for the quick reply.
But signing the assembly (for both projects) doesn't seem to solve the problem. the same error occures.
I tried adding test certificates to both projects, now i get an error that the manifest file can not be found...
ps: i'm using visual studio 2005
|
|
|
|
|
I have developed a windows application in C#.net that is running in the background like an antivirus.
But the problem is whenever i try to switch off my computer or try to restart my computer, the computer doesn't turns off/restarts.
And when i individually kills that windows(.exe) application listed out in Processes tab in Windows Task Manager and then tries to switch off the computer or restart it, Everything seems to be fine. How could i enhance or optimize my code so that whenever computer is turned off or is restarted, my application process should be killed automatically. Is there any class in .Net that could possibly find out , when computer is switched off or is restarted, so that i could kill down my application process at that time.
Anyone who could help me out in fixing the bug.
Thanks in Advance!!
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
When Windows wants to shut down it attempts to close all running applications cooperatively and your app must have refused that close request.
Have you coded a FormClosing event handler to stop the application closing?
e.g.
private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
e.Cancel = true;
}
The good news is that you can fix it.
Take a look at the FormClosingEventArgs.CloseReason Property and code something like this.
private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
if (e.CloseReason == CloseReason.WindowsShutDown) {
e.Cancel = false;
} else {
e.Cancel = true;
}
}
Alan.
modified on Thursday, February 12, 2009 11:17 AM
|
|
|
|
|
You are right Alan.
I have coded the same way as u have mentioned, to keep my apps running in the background.
Now i will change the code to your mentioned code.
Thanks for the solution.
Anyways is there any method where i can start my application and put the notification icon in system tray silently in the background, whenever computer is switched on or is restarted. It is similar to Gtalk or anti- virus starting their application whenever computer is turned on or is restarted.
And also Alan, i want my application to behave like system process, so that
no one could possibly kill that process from windows task manager processes list, except when computer is switched off. I have seen that you can cannot kill anti-virus processes from windows task manager.
How do one convert their application into system processes ensuring that the application could not be killed by administrator of computer(except when comp is switched off).
Looking for a solution to this Alan!
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
Vishnu Nath wrote: I have seen that you can cannot kill anti-virus processes from windows task manager.
You mean that you don't know how to kill that antivirus proces - that doesn't mean that it's not possible. I'm killing the Norton-scanner prior to each build, since Visual Studio requires the resources.
Vishnu Nath wrote: could not be killed by administrator of computer
I'd consider that a ransom-situation. The administrator owns the damn machine, and should have some control over what it does. Such programs are "malware" and Norton (or Avast, or MacAfee if they still exist) will try to remove it.
There's a huge difference in limiting the enduser and in limiting the administrator. Be carefull not to mix up both user-types
I are troll
|
|
|
|
|
You are right.
Thanks for your valuable advice and an important guidance to my project.
Thanks a Lot!!
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
Hi,
I think here you can run a small windows service related to your application, but am not sure about it.
or can try IPC concept.
regards,
ashok
|
|
|
|
|
Alan has given out me correct solution to my problem.
And now i dont face any problem in shutting down my PC after rectifying my code.
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
hi i am using a window form on vs 2005 with c#
i programically add in the items thru listbox.items.add()
however i am trying to add a values(which is hidden from the user)
as listbox.items.add("text") only add the text in but i cant seem to add a value in
anyone know how?
modified on Thursday, February 12, 2009 7:37 AM
|
|
|
|
|
neodeaths wrote: however i am trying to add values to it as well *e.g hidden values)
Can you edit this sentence to explain your requirement a little better. It's the "as well *e.g hidden values)" that has me baffled.
Alan
|
|
|
|
|
|
A bit but I'm still not sure I'm there completely. Do you want to add an item to the list box but not have it displayed, i.e. have an invisible item.
I must have misunderstood as that doesn't make a lot of sense to me.
Perhaps you mean that you have added some items to the list box but they are not being displayed. Is that it?
Alan.
|
|
|
|
|
iam trying to hide a value from the user but still show certain infomation thats y iam doing the items adding programmically
|
|
|
|
|
The ListBox is an user interface element and it's function is to display items. You can't selectively hide certain items.
What you can do is store all your items in a list and then only add the items that you want the user to see to the ListBox.
Alan.
|
|
|
|
|
I'm quite happy to assist you with programming but I don't want to have spend time interpreting your text speak such as "y iam".
So please make it easy for people to help you!
Alan.
|
|
|
|
|
|
How to get/store all VSS(Visual Source Safe) user names inside the windows DataGridView control or inside a physical table in database ?
Please reply.
Thanks
Raj Ram
raj
|
|
|
|
|
Hi there,
Try by referencing Microsoft.VisualStudio.SourceSafe.Interop.dll
You may use IVSSDatabase class which has Users property.
Calin
|
|
|
|
|
I have developed a windows Application/Tool in C#.Net which is about to be released as a Beta version.
I need to add an Auto Update Feature to my Tool similar to FireFox Software Update.
This Feature should be able to notify End User about the new Version's availability and allow them to Update their Tool.However while updating the Tool, it should only update the required Files(.dll or .exe).The Tool always runs in the background, so without impacting the current process it should update the Tool. I have looked out for many solution but they simply don't meet my requirements.
It would be helpfull, if any one of you come out with the solution.
Thanks in Advance!
Aspiring Techie,
Vishnu Nath
|
|
|
|
|
|
Hi Guys,
Sorry if I am posting this in the wrong Forum. I have an web app that makes use of the ReportViewer control. In this control I am calling a Remote SQL 2005 Report. This app works fine if I run in from IIS. I can export without any issues.
We added this app into a Portal which is a Windows App and uses the Web Browser Control to display aspx pages. The page and the report displays just fine, but when I try to export the report using the Export link on the ReportViewer toolbar I get the following Error Message:
ASP.NET session has expired. Can anyone please give me guidance as to what I must do to be able to get this report exportable.
Your help is greatly appreciated.
Elizma
|
|
|
|
|
Try the ASP.NET forum, you will get better responses.
|
|
|
|
|
I have a grid with date data displaying as YY/MM/DD inside it with update functionality.
I want to check that user cant enter date with any other format.
|
|
|
|
|
The process you need to do is called validation.
If you google for 'validate' AND 'insert the type of grid you are using here', you will get thousands of possible solutions.
Do a little work first, then if you get stuck on a particular part of it, ask again.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I have a project working with WSE 3.
The service:
[Policy("StandardServicePolicy")]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public string PlainHelloWorld(string test)
{
return string.Format("{0} = {1}",test,DateTime.Now.ToString("dd/MM/yyyy"));
}
}
file app.config for service
<configuration>
<configsections>
<section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configsections>
<microsoft.web.services3>
<policy filename="wse3policyCache.config" />
</microsoft.web.services3>
</configuration>
and the wse3policyCache.config file:
<policies xmlns="http://schemas.microsoft.com/wse/2005/06/policy">
<extensions>
<extension name="usernameForCertificateSecurity" type="Microsoft.Web.Services3.Design.UsernameForCertificateAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="x509" type="Microsoft.Web.Services3.Design.X509TokenProvider, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="requireActionHeader" type="Microsoft.Web.Services3.Design.RequireActionHeaderAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</extensions>
<policy name="StandardServicePolicy">
<usernameforcertificatesecurity establishsecuritycontext="false" renewexpiredsecuritycontext="true" requiresignatureconfirmation="false" messageprotectionorder="SignBeforeEncrypt" requirederivedkeys="false" ttlinseconds="300">
<servicetoken>
<x509 storelocation="LocalMachine" storename="My" findvalue="CN=TEST" findtype="FindBySubjectDistinguishedName" />
</servicetoken>
<protection>
<request signatureoptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptbody="true" />
<response signatureoptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptbody="true" />
<fault signatureoptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptbody="false" />
</protection>
</usernameforcertificatesecurity>
<authorization>
<allow user="CN=CIC2008" />
<deny user="*" />
</authorization>
<requireactionheader />
</policy>
</policies>
The client:
localhost.Service1Wse service = new StandardServicePolicyApp.localhost.Service1Wse();
service.SetClientCredential(token);
Policy policy = CreatePolicy();
service.SetPolicy("StandardClientPolicy");
MessageBox.Show(service.PlainHelloWorld("Test"));
the app.config file in client:
<configuration>
<configsections>
<section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<sectiongroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="StandardServicePolicyApp.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirepermission="false" />
</sectiongroup>
</configsections>
<microsoft.web.services3>
<policy filename="wse3policyCache.config" />
</microsoft.web.services3>
<applicationsettings>
<standardservicepolicyapp.properties.settings>
<setting name="StandardServicePolicyApp_localhost_Service1" serializeas="String">
<value>http://localhost:7703/Service1.asmx</value>
</setting>
</standardservicepolicyapp.properties.settings>
</applicationsettings>
</configuration>
and the wse3policyCache.config in client
<policies xmlns="http://schemas.microsoft.com/wse/2005/06/policy">
<extensions>
<extension name="usernameForCertificateSecurity" type="Microsoft.Web.Services3.Design.UsernameForCertificateAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="x509" type="Microsoft.Web.Services3.Design.X509TokenProvider, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension name="requireActionHeader" type="Microsoft.Web.Services3.Design.RequireActionHeaderAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</extensions>
<policy name="StandardClientPolicy">
<usernameforcertificatesecurity establishsecuritycontext="false" renewexpiredsecuritycontext="true" requiresignatureconfirmation="false" messageprotectionorder="SignBeforeEncrypt" requirederivedkeys="false" ttlinseconds="300">
<servicetoken>
<x509 storelocation="CurrentUser" storename="My" findvalue="CN=TEST" findtype="FindBySubjectDistinguishedName" />
</servicetoken>
<protection>
<request signatureoptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptbody="true" />
<response signatureoptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptbody="true" />
<fault signatureoptions="IncludeAddressing, IncludeTimestamp, IncludeSoapBody" encryptbody="false" />
</protection>
</usernameforcertificatesecurity>
<requireactionheader />
</policy>
</policies>
with the Certificate file with CN = TEST.
When I run this project, the error message has been throw
WSE910: An error happened during the processing of a response message, and you can find the error in the inner exception. You can also find the response message in the Response property.
Security requirements are not satisfied because the security header is not present in the incoming message.
How can I fix this error??? Please help me!!!!
Thanks !
How can I fix this error
I am 27 years old and I'm working with C# and Visual Basic .NET.
I've worked also as Win developer and Web developer.
I like to share as much as possible knowledge and projects with other people.
|
|
|
|
|