473,659 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Code Access Security problems within a Windows Service

Hello
I have created an assembly to print a pdf document and I wrote some unit tests and everything works from within nuint and cruisecontrol.n et. ( I am using C#)
Next I have to put together a Windows Service, which checks in a specific directory for pdf files and prints them automatically. I hoped to reuse my assembly, however when I use it within the windows service, nothing happens, it does not print. I even don't get an exception. Does anybody know if this could have anything to do with code access security?

Please find below a simplified version of my assembly for printing a pdf file:

public class PdfPrinter
{
public void PrintPdfDocumen t(string SourceFile)
{
System.Diagnost ics.ProcessStar tInfo info = new
Sstem.Diagnosti cs.ProcessStart Info();
info.WorkingDir ectory = c:\Program Files\Adobe\Acr obat 4.0\Reader";
info.FileName = info.WorkingDir ectory + "\\AcroRd32.exe ";
info.Arguments = @" /t " + SourceFile;

info.CreateNoWi ndow = true;
info.UseShellEx ecute = false;
info.WindowStyl e=System.Diagno stics.ProcessWi ndowStyle.Hidde n;

System.Diagnost ics.Process process = new System.Diagnost ics.Process();
process.EnableR aisingEvents = true;
process.StartIn fo = info;
process.Start() ;
}
}
Jul 21 '05 #1
0 1453

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5853
by: doug.h.taylor.accipitersoftware.com | last post by:
Hi, I need a general direction. I don't even know where to start researching how to do this. I have an existing dot net web application (It's mine, I wrote it) that has some text fields and a button. The code-behind click event of the button sends an SNPP conversation to a pager server. I also have an existing dot net windows service running on a dedicated
8
2009
by: Russ | last post by:
Hello. I have a very large business application written all in VC++ and MFC. Now I want to interface some of it to the web. I have VS.NET2003 and have been studing walkthroughs and documentation and trying some things. I wanted to build an XML web service that would interface to my existing data and classes. But most of the examples are for C#, which I do not know, and which can not understand the C++ header files needed to interface...
2
1568
by: John J. Hughes II | last post by:
I am having some major problem with maintaining security for my windows application to the SQL. Currently my application access the SQL using System.Data.SqlClient and all forms use stored procedures. It seems the preferred method is to restrict access to all table and then to set the execute option based on each stored procedure and handle the error in some intelligent way. Now this is causing several problems the first being setting...
4
1850
by: sea | last post by:
I have a database in Access 2002 but I am unable to view code or write any modules when logged in with a limited user account using Windows XP, service pack 2 -- no problems when logging in as administrator, -- any ideas on how a limited user on Windows XP can access code and modules in Access 2002? Thank you very much.
0
362
by: gmesmer | last post by:
Hello I have created an assembly to print a pdf document and I wrote some unit tests and everything works from within nuint and cruisecontrol.net. ( I am using C#) Next I have to put together a Windows Service, which checks in a specific directory for pdf files and prints them automatically. I hoped to reuse my assembly, however when I use it within the windows service, nothing happens, it does not print. I even don't get an exception. Does...
4
3603
by: TrinityPete | last post by:
Hi all, We have a web application that uses web services for data access and retrieval. The web app and web services reside under IIS on the same server(WIN2003). The virtual directories have been set for windows authentication and both the ASP web application and the web services are using windows authentication with impersonation of the logged on user. We also set the web service credentials to CredentialCache.DefaultCredentials. ...
17
4403
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting there, but is there a way they can find out if that application was put there from a CD or email or created at work? Hint: It's not on a client/server database, just native jet database mdb created on Access 2003 (default 2000)...
7
2062
by: clintonG | last post by:
To all Microsoft partners and customers who have been unable to download recently or access ASP.NET documentation from the msdn2 website and for all of those customers who have been lied to and misled by some of the sleazy MVPs and the lying cockroaches that Microsoft has working for the company... Microsoft has serious problems with their servers and websites. The entire MSDN server farm and all download resources MSDN manages has been...
3
1674
by: Earl Anderson | last post by:
One of the users in our departmental db has Read/Write permissions to a particular form. He was able to access and edit the form at will until 2 weeks ago. His current problem was that he was not able to edit the data (no message ever appeared telling him he could not change any data). The only change to the db since he experienced the problem was that a new version of the db was made available for installation which everyone has now...
0
8332
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8525
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2750
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.