473,668 Members | 2,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.F ile.Exists(file Name))
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.Fi leIOPermission, mscorlib,Versio n=2.0.0.0
Culture=neutral PublickKeyToken =b77a5c561934e0 89 Failed.

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

please help...
Sep 18 '08 #1
1 2266
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.Sho w("11111");
* *if(!System.IO. File.Exists(fil eName))
* * *System.IO.File .Create(fileNam e);
* *MessageBox.Sho w("22222");
*}
*catch (Exception e)
*{
*MessageBox.Sho w(e.Message);
*result = false;
*}
*return result;
*}

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

The error message:

System.Security .Permissions.Fi leIOPermission, mscorlib,Versio n=2.0.0.0
Culture=neutral PublickKeyToken =b77a5c561934e0 89 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
5515
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 the records, create an excel file that contians the records that do not pass the validation, send this Excel file back to the person who sent me the original spreadsheet. They will send the Excel Spreadsheet back once they correct the records. ...
3
2320
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 C# client having activex control embedded at the very beginning (added in the design window); then, I created another same activex control at the runtime. After the 2nd activex control is created, I start to get errors on the function calls to the...
2
1794
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 they all seem to say either nothing about this or that this is "out of the scope of this book", even "Professional ASP.NET". I have a ActiveX component that I'd like to expose through a .NET wrapper so in the case that a client browses to my...
1
3105
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 they all seem to say either nothing about this or that this is "out of the scope of this book", even "Professional ASP.NET". I have a ActiveX component that I'd like to expose through a .NET wrapper so in the case that a client browses to my...
3
22846
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 to do it, if any sample is provided will be of great help Thanks EJ
4
3422
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 working once I changed it to run on the server (runat="server"). It said the GUID was wrong. I found code showing how to implement an activex control using the HtmlGenericControl class from the code behind file, but I can't figure out how to call...
2
2972
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 of this control class and use it right away, When I create an object and use the control, some of the methods dont work because the ActiveX control is not initialized properly. Does anyone have an idea on how to initialize an ActiveX control...
2
1640
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. http://www.codeproject.com/KB/miscctrl/exposingdotnetcontrols.aspx?forumid=2373&select=1336367&app=50&df=100&msg=1336367 Good luck.
3
1857
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 server when hosted within a browser from anywhere.Originally we were planning on using port forwarding...and having the externalip:databaseport forward from the web server to the database server. But our customer's network admin says this is not...
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8381
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,...
0
8797
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8656
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
7401
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...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2791
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
2023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1786
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.