|
Microsoft offer Office interop libraries so you can call excel. Passing data into Access is trivial and well documented on the web.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
HI,
it is possible to print the content of an object panel, as an example a design?
Thanks
Alex
|
|
|
|
|
Hi.
Do you have any idea of how could the path to the exe file of an installed application(like MS Words or Adobe Reader) be found?
Thanks.
|
|
|
|
|
If it has a file type associated with it ( like doc or pdf ), then you can find it in the registry. That's how windows knows how to open a file when you double click on it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
This is my first post, so please excuse my poor english or if I miss giving you important info.
I need to start a windowless exe file from an internal website. I have been using System.Diagnostics.Process with credentiels and without. If I use it with credentiels I get a "The application failed to initialize properly (0xc0000142)." error and without I get different sort of errors from the application I am trying to start.
The exe I want to start is written in C# (as is the website), and I have the sourcecode for the exe.
The website and the exe file is running on the same machine (a 2003 server). The exe is also running every night by a scheduled task. I have been trying to start the scheduled task aswell, but hit a dead rock there aswell...
Does anyone have a good formula for doing this? As this is on an internal website the security issues are less crusial (but still important).
Best Regards
Caroline
|
|
|
|
|
Caroline Ledin wrote: As this is on an internal website the security issues are less crusial (but still important).
Statistically, most computer crime is an inside job. Therefore, logically, more emphasis should be put on security for internal applications. But that rarely happens.
Caroline Ledin wrote: I get different sort of errors from the application I am trying to start.
What is the error?
Also, remember that if you start the process from the web application you will be using the same credentials as the web application, usually the ASPNET account. Could it be that the application requires more rights to operate than the ASPNET account permits?
Caroline Ledin wrote: The exe is also running every night by a scheduled task. I have been trying to start the scheduled task aswell, but hit a dead rock there aswell...
Are there any error messages from that scenario?
|
|
|
|
|
The error's I get from the application is
1.System.Security.SecurityException: That assembly does not allow partially trusted callers
When I got this error, I added the ASP-user to the security tab of the exe file.
After that I got the next error message:
2.An unhandled exception ('System.IO.FileLoadException') occurred in BankService.exe
And I was stuck again...
When I run the Scheduler task option I did the following
exeProcess.StartInfo.FileName = "schtask";
exeProcess.StartInfo.Arguments ="/run /tn BankService";
and
exeProcess.StartInfo.FileName = "cmd";
exeProcess.StartInfo.Arguments ="schtask /run /tn BankService";
It didnt do anything...
I checked the scheduler and nothing had happened and I checked the Task manager and no process with the bankservice had started.
The exe im trying to start I have stripped from doing anything but Console.WriteLine and EventLog.WriteEntry.
In the webconfig file it is added (not due to this)
<identity impersonate="true" userName="xxxx" password="yyyy"/>
How do I set the asp net user to access the desktop or can I get the process to run as antoher user but the net user?. The website requires you to log in with your windows credentiels...
/Caroline
|
|
|
|
|
Caroline Ledin wrote: windowless exe file
Sounds like what you need to do is write it as a service, I'm pretty sure you can set up a service to be called from an ASP.NET app.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
if that is a .net exe then add it in GAC. with "gacutil -i exe_path"
then give full trust to it with "caspol -af exe_path" use sdk command prompt.
Add this in webconfig.
<identity impersonate="true"/>
try ur program after that.
|
|
|
|
|
sorry for the late reply, but had to try/fix a few things to get it all working.
I have installed the exe with the gacutil tool and had to strong name type it first...
Then when I try the caspol command I get an error
Usage: caspol <option> <args> ...
any suggestions on this error?
I hate to be forced to make a service out of this....
Thanks for the help by the way
/Caroline
|
|
|
|
|
Made the service and is stuck on yet another access denied problem...
When I try to start the service
myControl = new ServiceController("StartSchTask");
String[] args;
args = new String[2];
args[0] = "BankService";
args[1] = "cl@ikaros.se";
myControl.Start(args);
I get the "Cannot start service StartSchTask on computer '.'." error and I believe that this is an access denied error....
any suggestions...*banging head into the wall...*
/Caroline
|
|
|
|
|
hi i keep getting this error:
Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level.
below is my code and yes i am trying to do remoting combined wit delegate.
please help me if you can ,thx.
i read about this something http://www.codeproject.com/useritems/RemotingEvent.asp[^]
but i dont use configuration file so how can i set the <formatter ref="soap" typeFilterLevel="Full" />
using System;<br />
<br />
class DelegateDemo<br />
{<br />
delegate String DelegateAbc(String txt);<br />
<br />
public String TestAbc(String txt)<br />
{<br />
Console.WriteLine(txt);<br />
return "Hello from TestAbc";<br />
}<br />
public static String TestStatic(String txt)<br />
{<br />
Console.WriteLine(txt);<br />
return "Hello from TestStatic";<br />
}<br />
static void Main()<br />
{<br />
DelegateDemo t1 = new DelegateDemo();<br />
DelegateAbc d1 = new DelegateAbc(t1.TestAbc);<br />
Console.WriteLine(d1("First call"));<br />
d1 = new DelegateAbc(DelegateDemo.TestStatic);<br />
Console.WriteLine(d1("Second call"));<br />
<br />
cow asdd = new cow();<br />
asdd.setter();<br />
Console.ReadLine();<br />
}<br />
<br />
<br />
<br />
public class moo<br />
{<br />
string data;<br />
<br />
Delegateking abc;<br />
public moo(Delegate lol)<br />
{<br />
abc = (Delegateking)lol;<br />
}<br />
public void set()<br />
{<br />
abc();<br />
}<br />
}<br />
delegate void Delegateking();<br />
public class cow<br />
{<br />
<br />
<br />
moo hihi;<br />
public cow()<br />
{<br />
<br />
Delegateking lala = new Delegateking(this.setter);<br />
hihi = new moo(lala);<br />
}<br />
public void setter()<br />
{<br />
Console.WriteLine("power");<br />
}<br />
}<br />
}
-- modified at 5:08 Friday 11th May, 2007
|
|
|
|
|
I have set my dataconfig file for DB connection using Enterprise Library.
Now i want to use the one of the DBinstance for my Crystal reports connection info.
How can access the dataconfig file from my C# class to obtain the value...
Thanks in Advance
Hema S
|
|
|
|
|
Managed to find.
Any one looking for the same soln here it is..
DatabaseSettings databaseSettings =(DatabaseSettings)ConfigurationManager.GetConfiguration("dataConfiguration");
InstanceData instance =
databaseSettings.Instances["instance name"];
ConnectionStringData connectionString = databaseSettings.ConnectionStrings[instance.ConnectionString];
DatabaseTypeData type = databaseSettings.DatabaseTypes[instance.DatabaseTypeName];
string database=connectionString.Parameters["database"].Value;
similarly you can look for any property u wish to...
Hema S
|
|
|
|
|
The aim is to output double values by using .ToString() or one of its overloads.
<br />
double d = 0.0000001; <br />
Console.WriteLine(d.ToString()); <br />
How can I force the output format to be of a specific type? I'd like to output various double values in a format that always exposes a decimal point: 0.000001 instead of 1E-06
I've already tried .ToString("g") but that only works up to 0.0001.
Many thanks in advance.
Goebel
|
|
|
|
|
Look at the String.Format method!
like:
int numberofdecpoints= 10;
double actualvalue = 0.0000001;
String.Format("{0:F"+ numberofdecpoints.ToString() +"}",actualvalue);
Hope it helps!
All the best,
MArtin
|
|
|
|
|
It's a start, thanks!
Is there a way to store that double value in a string variable using that decimal point format?
Cheers,
Goebel
|
|
|
|
|
String.Format method returns a new string instance.
Or did you mean something else?
All the best,
Martin
|
|
|
|
|
Hoky doky, works all right
First I worked with Console.WriteLine() implicitly using String.Format. Didn't realize that a string was returned though.
Thanks again,
Goebel
|
|
|
|
|
|
Good morning people,
Any idea how to make MS Agent characters listen for commands without having to press the ScrLK "Scroll Lock" button??
Many thanks
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello, good people!
How can I print PDF files from C# code?
What components are required for this task? Are there any free solutions?
Thanks a lot!
|
|
|
|
|
hmm you could use an pdf printer? just an idea, i'm not sure if it is possible
Stef
|
|
|
|
|
Hi,
assuming the PDF extension is associated to a program that can open and print PDF files,
you could use Process.Start() with a ProcessStartInfo.Verb="Print".
|
|
|
|
|
Dear All.
I want to store my data(username and password) in SQL using c#. I want to encrypt the password using C# cryptography. I want to store this encrypted password in database. How? Later I want to decrypt the password while reteriving it from database.
Actually what happens in real time ? How they store password ? Can any one clear my doubt ?
Thanx,
|
|
|
|