|
... or (if the service is unecessary) put the path to your app in the registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Value name: Your App
Value Data: Your_App_Path
|
|
|
|
|
i have a windows control which is to be loaded on a webpage(.aspx page)
control is loaded with the aid of "object" tag
the control is developed in C#.net(managed code basically)
the control makes use of the system resources and even makes use of some other dll's too
problem:
the control fails to load on the webpage
first solution tried:
change the .net security with the aid of caspol
so i tried giving full trust to all code
this worked fine and the control got loaded.
however this worked fine only when the webpage was a part of the default website in IIS
in case if the webpage which hosts the control is a part of a virtual website apart from the default website
the control is failing to load
so what might be the problem...??
from some of the blogs which i read...the .net tries to give trust
to assemblies based on from where the assembly is getting streamed
so i also tried to load the control by making this site a trusted one
still the control didn't load
any idea...as to might b wrong....
|
|
|
|
|
naveen1382 wrote: have a windows control which is to be loaded on a webpage
Right there is probably your problem...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Paul Conrad wrote: Right there is probably your problem...
Why's that then?
C# has already designed away most of the tedium of C++.
|
|
|
|
|
I've been working on something very similar recently, and having almost identiacal problems!
I'm a lil confused by your post however - what do you mean by Virtual Website? Do you mean that the folder you're hosting the control in is a virtual directory, configured in IIS?
If this is the case, you shouldn't be having any problems - but of course we always do! Some things to check would be to ensure that the control is actually being served by IIS - I had issues with the control not being downloaded. Simplest way to check is to clear out temp internet files, navigate to the page, then check that the .dll has appeared in the folder (View files from IE Tools-> Internet Options) If it hasn't appeared, then the problem is with IIS, if it has, then probably a security issue.
If it isn't being served, check that the application's Execute Permissions (IIS Admin -> Site Properties) are set to Scripts only - i had mine set to Scripts and Executables, so when requested, IIS was treating my dll as an exe, and attempting to run it rather than serve to the client.
If it's a security issue, it may be that the evidence you're using isn't quite right. Most of the docs recommend using strong name evidence. The problem with this is that is causes stack walk problems with the app domain. I used site evidence, at the all code level, by issuing:
caspol -m -ag 1 -site www.mysite.com FullTrust -n MyGroupName
This creates a sub group of the All code group at the Machine level, granting full trust to anything from www.mysite.com.
Hopefully this helps
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Hi
I have the following code which is supposed to increment 1 but it seems to be incrementing by 3
any suggestions?
cheers
string maxquery = "Select max(activity_order) from roomactivitylk where room_code = 'v1106'";
int max;
SqlCommand cmd15 = new SqlCommand();
cmd15.Connection = con;
cmd15.CommandText = maxquery;
max = Convert.ToInt32 (cmd15.ExecuteScalar());
max = max + 1;
++max;
max++;(needs to only be one of these)
modified on Monday, December 10, 2007 4:41:39 AM
|
|
|
|
|
Jamie1985 wrote: max = max + 1;
++max;
max++;
Each of these lines increments max by one.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Jamie1985 wrote: max = max + 1;
++max;
max++;
Why do you write like that?
use only one. eg. max++;
|
|
|
|
|
thanks managed to sort it, you were right
cheers
|
|
|
|
|
If that was really your problem, you can't have possibly written the DB code you posted ? You should buy a C# programming book and work through it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Jamie1985 wrote: I have the following code which is supposed to increment 1 but it seems to be incrementing by 3
Why you given it 3 times ?
Jamie1985 wrote: max = max + 1;
Increments 1 to max value
Jamie1985 wrote: ++max;
Pre-increment. max value won't be changed
Jamie1985 wrote: max++;
Post-increment. Same like the first one.
|
|
|
|
|
N a v a n e e t h wrote: Pre-increment. max value won't be changed
I thought it would, it just works in a different order, like:
int a;<br />
int b = 4;<br />
int c = 3;<br />
<br />
a = b++*c;<br />
<br />
b=4;<br />
c=3;<br />
<br />
a = ++b*c;<br />
I'll have to go check now.
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
SK Genius wrote: I thought it would, it just works in a different order, like:
OOPS, I am wrong. Whatever you said is correct.
|
|
|
|
|
Hi
I need to draw images into the device screen using filter graph is it possible?
Regards
Sheeja. A.L
|
|
|
|
|
Hi,
iam doing windows application in c#
my windows form consists of textboxes,lables,buttons and datagridview control..
now i want to print the form...is there any code for both form controls and datagridview control printing ....
thanks in advance..
with regards
murali
murali krishna
|
|
|
|
|
1. Use BitBlt API or PrintWindows API to capture the screenshot of your window form.
2. Save it as image in your memory stream or disk.
3. Print this image.
Example : Printing a Windows Form[^]
Hope it helps.
|
|
|
|
|
Image of complete form or image of any control can be drawn on a bitmap object using Control.DrawToBitmap() function, here it would be something like, this.DrawToBitmap().
Once you get snapshot on a bitmap object, use PrintDocument control and draw this image using e.Graphics.DrawImage in PrintPage event of PrintDocument.
I hope this helps.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
I have installed an application using clickonce.
The user is running the application on wini xp pro machine.
Not sure why the user sometimes gets the following message when trying to open the application.
In case it makes any difference, the application is written in .net 2.0
Any thoughts please?
Here is the error message:
Cannot Start Application
Cannot continue. The application is improperly formatted.
Contact the application vendor for assistance.
OK Details…
PLATFORM VERSION INFO
Windows : 5.1.2600.131072 (Win32NT)
Common Language Runtime : 2.0.50727.42
System.Deployment.dll : 2.0.50727.42 (RTM.050727-4200)
mscorwks.dll : 2.0.50727.42 (RTM.050727-4200)
dfdll.dll : 2.0.50727.42 (RTM.050727-4200)
dfshim.dll : 2.0.50727.42 (RTM.050727-4200)
SOURCES
Deployment url : file:///C:/Documents%20and%20Settings/engelber/Start%20Menu/Programs/xyz%20Europe/PricingAnalytics.appref-ms
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Documents and Settings\engelber\Start Menu\Programs\xyz Europe\PricingAnalytics.appref-ms resulted in exception. Following failure messages were detected:
+ Exception reading manifest from http://ldn03a01/PricingAnalytics/PricingAnalytics.application: the manifest may not be valid or the file could not be opened.
+ The 'link' start tag on line 20 does not match the end tag of 'head'. Line 222, position 3.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [10/12/2007 07:05:54] : Activation of C:\Documents and Settings\engelber\Start Menu\Programs\xyz Europe\PricingAnalytics.appref-ms has started.
* [10/12/2007 07:05:54] : Performing necessary update check as specified by the deployment.
ERROR DETAILS
Following errors were detected during this operation.
* [10/12/2007 07:05:54] System.Deployment.Application.InvalidDeploymentException (ManifestParse)
- Exception reading manifest from http://ldn03a01/PricingAnalytics/PricingAnalytics.application: the manifest may not be valid or the file could not be opened.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirect(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifest(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentUpdate(SubscriptionState subState)
at System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String shortcutFile, TempFile& deployFile)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Xml.XmlException
- The 'link' start tag on line 20 does not match the end tag of 'head'. Line 222, position 3.
- Source: System.Xml
- Stack trace:
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()
at System.Xml.XmlCharCheckingReader.Read()
at System.Xml.XsdValidatingReader.Read()
at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
|
|
|
|
|
either *.application (e.g. Shell.application) or *.exe.manifest (e.g. Shell.exe.manifest) is invalid. So, try to fix those files by using megaui tool or republish your application.
|
|
|
|
|
Hi,
How do I create the aspx page on the fly? is there any better solution.
|
|
|
|
|
1 - ask in the ASP.NET forum
2 - why do you want to, and what do you mean by 'on the fly' ? ASP.NET allows you to use things like literal controls to generate any HTML you like. You can also create controls themselves on the fly, but if you do, you'll have to work hard to get events from them.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Use file manipulation function to create a file and write contents into that following ASP.NET syntax. This newly created page won't have a code-behind file. You need to write server side scripts in ASPX page itself. But this method is tough for doing changes to the page.
|
|
|
|
|
What am I doing wrong in this snippet of code? I can't seem to figure out how to make this work:
using System;
public class DebugFive2
{
public static void Main()
{
const string pass1 = home;
const string pass2 = house;
const string pass3 = mouse;
string password;
Console.Write("Please enter your password ");
password = Console.ReadLine();
while(password != pass1 || password != pass2 || password != pass3)
Console.WriteLine("Invalid password. Please enter again. ");
password = Console.ReadLine();
Console.WriteLine("Valid password");
}
}
Any help would be greatly appreciated
|
|
|
|
|
First: you should get an compiler error with the consts - use const string pass1 = "home"; for example
Second: in your while-loop you are just using the Writeline (no block) - use this:
<br />
{<br />
Consoloe.WriteLine(....<br />
password = ....<br />
}<br />
Then your problem is with the ORs (||):
You iterate the while-loop as long the password is not pass1 OR not pass2 OR not pass3 and as pass1 != pass2 != pass3 you will satisfy this contition no matter what the input is - so just use && instead of || (substituting OR with AND) and it will work.
|
|
|
|
|
Thanks CKnig, that definitely cleared things up for me. I appreciate your help!
|
|
|
|