473,395 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Using C# to create ActiveX

JUN
Hi all,

I use c# to create ActiveX control, and works under IE browser.

Now, i add a "Save" procedure for this ActiveX,but in Client
calling ,it not works.

the save procedure:

public Boolean Save(String fileName)
{
Boolean result = false;
try {
MessageBox.Show("11111");
if(!System.IO.File.Exists(fileName))
System.IO.File.Create(fileName);
MessageBox.Show("22222");
}
catch (Exception e)
{
MessageBox.Show(e.Message);
result = false;
}
return result;
}

the client (javascript code)
Object1.Save("c:\\aaa.txt");

The error message:

System.Security.Permissions.FileIOPermission,mscor lib,Version=2.0.0.0
Culture=neutral PublickKeyToken=b77a5c561934e089 Failed.

I have set this Assembly to FullTrust. but still not works.

please help...
Sep 18 '08 #1
1 2251
On Sep 18, 7:30*am, JUN <youk...@gmail.comwrote:
* I use c# to create ActiveX control, and works under IE browser.
First of all, it's not ActiveX; it's a hosted Windows Forms control.
* Now, i add a "Save" procedure for this ActiveX,but in Client
calling ,it not works.

* the save procedure:

*public Boolean Save(String fileName)
*{
*Boolean result = false;
*try *{
* *MessageBox.Show("11111");
* *if(!System.IO.File.Exists(fileName))
* * *System.IO.File.Create(fileName);
* *MessageBox.Show("22222");
*}
*catch (Exception e)
*{
*MessageBox.Show(e.Message);
*result = false;
*}
*return result;
*}

the client (javascript code)
Object1.Save("c:\\aaa.txt");

The error message:

System.Security.Permissions.FileIOPermission,mscor lib,Version=2.0.0.0
Culture=neutral PublickKeyToken=b77a5c561934e089 Failed.

I have set this Assembly to FullTrust. but still not works.
How did you do that?
Sep 18 '08 #2

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

Similar topics

0
by: Jeff | last post by:
I will start off by giving you a background of the process I am taking. The nature of my DTS package is that I recieve an Excel Spreadsheet, run it through the DTS Package applying validation to...
3
by: fumihiko | last post by:
Hi, I created an activex control (C++), and it uses another COM dll (C++). This COM dll links with a static library that dose some calculation. (both are debug multithreaded dll) I created a...
2
by: Mehr H | last post by:
I have been working on this for several days and am still have had no success in achieving this. Pleae help. It seems that documentation for this is very limited. I have looked in several books and...
1
by: Mehr H | last post by:
I have been working on this for several days and am still have had no success in achieving this. Pleae help. It seems that documentation for this is very limited. I have looked in several books and...
3
by: EJ1003 | last post by:
Hello I would like to create Activex Control uisng C# and use it in ASP.Net webform. User Control is not solving my requirement so I am going for Activex Control. Please guide me on this, how...
4
by: qualitynice | last post by:
HELP :-)... I'm creating an embedded activex object in an asp.net page using the HtmlGenericControl class. I'm doing this because when I tried to embed it directly in the aspx page, it stopped...
2
by: abhimanyu | last post by:
Hi, I am building a project using C# in VS2005. I need to use a COM ActiveX control in my project but I do not have a Form on which I want to place this control. I only want to create an object...
2
by: estufa | last post by:
Hi I see some questions about creating ActiveX controls using .NET. I found the answer in this page and it works really good for me....
3
by: tuvman | last post by:
We are developing a web application. Our web app is a heavy client- our existing .net app exposed as an activex control running in IE. We need the activex to be able to access our remote database...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.