this is my first thread here and I am trying to be as accurate as possible. Furthermore I am not a native speaker so I am sorry in advance for any spelling or grammar mistakes.
I've just started working on a project to automate the parameterization of Siemens drives with the software Siemens Starter v4.4.
The project description is to write some VB-Scripts to set values in the Starter software and to have an html frontend for the user.
The problem is, that my company is always using the most recent Internet Explorer version. But unfortunetly VBS can only interface correctly with IE10 or lower.
Therefore I am wondering if it is possible to have a standalone IE10 portable installation next to the required scripts. The problem as far as I know is to access the objects used for the communication of IE and VBS.
Of course I am open for any other method of creating a simple frontend.
I am not a professional developer and have to teach myself. Despite of that I have some programming experience in C, C++, C# and VBS. Therefore I would appreciate a solution where I can find some online help and documentation for.
Thank you in advance.
Sorry for this newbie type question. I am not a Cognos developer.
Is there a way to embed C# or PHP code in Cognos? I tried putting some PHP code in a HTML block but that didn't work. Our Cognos installation is on IIS 7.
And what are you trying to achieve with PHP or C#? People usually use Javascript in reports, but if you want to use other languages like PHP, you can try out Cognos Mashup Services.
http://www.ibm.com/developerworks/data/library/techarticle/dm-1001cognosmashup/
Be aware, you need to have an SDK license to use it (at least needed the last time I check). Maybe worth running this through IBM rep.
In C#, Is it possible to dynamicaly load a .NET library at runtime with using something like System.Reflection.Assembly.LoadFile & disabling the loaded library from using [DllImport("someCPP.DLL", EntryPoint ="someFunction")] so that you can't call c++ stuff for security reasons??
The reason for this question is i'm thinking about making a generic openSource browser plugin that could run any .NET code & display things like OpenGL or Direct3D or whatever content you want in the browser using .NET. This would need the loaded .NET library to be secure though by disabling "DllImport" & maybe some other things. Is this possible?
You can use an application domain with restricted security permissions.
Here is a general introduction to application domains:
Application Domains (C# and Visual Basic)
And here is the specific permission related to executing unmanaged code:
SecurityPermissionFlag.UnmanagedCode
Ok this situation is a bit difficult. But I am trying to embed a Java Jar into a C# form. Not as a new window or new process.
The Jar will be a game that uses the LWJGL library.
The C# Form will be a "wrapper" for it with tools and more.
Anyone have any ideas? Is this even possible?
According to the IKVM Home Page
IKVM.NET is an implementation of Java
for Mono and the Microsoft .NET
Framework. It includes the following
components:
A Java Virtual Machine implemented in
.NET A .NET implementation of the Java
class libraries Tools that enable Java
and .NET interoperability
One would approach it from using a DLL not a jar. Also this sounds like a bit of a security issue.
They're completely different runtimes; you'll need a process for both the CLR and the JVM; no way around that.
You can try the Java to C# converter provided by MS, and then rebuild: http://www.microsoft.com/downloads/details.aspx?FamilyID=46bea47e-d47f-4349-9b4f-904b0a973174&displaylang=en
Can I communicate to Google Chrome in C#?
For writing a chrome plugin for example.
<Spoilers>
Quick short answer: No, because Extensions require JSON, JavaScript, and HTML.
</Spoilers>
Hi Tony,
There are multiple templates on the internet that you can download to build a chrome extension project using Visual Studio.
Downloading one of these templates just gives you the files and folders that you need which I call "the setup".
That won't let you build a Google extension using C#.
Andrey mentioned that there are libraries like Bridge.NET that will compile your code into HTML/JavaScript. That will help you write HTML and JavaScript using C#. You still need a manifest.json file.
I don't recommend that. That library is not designed for Chrome Extensions. Also, you will have to compile the code into JavaScript and store that JavaScript code in a JavaScript file. I recommend using HTML/JavaScript with no compilers when building your Chrome Extension.
You need to keep in mind that there are 3 main parts in a chrome extension. These are:
manifest.json
A JavaScript file
HTML file
There are multiple steps and it's not hard to build a google chrome extension. This link will give you the complete tutorial on developing a chrome extension with detailed explanation. This tutorial installs a template so that you can develop it in Visual Studio just like I mentioned before.
What I have done to address is use Simple Message Host, it will trigger an executable on the local machine that you code in c#, sending stdin messages and listening to stdout messages so you can build this host to use as a bridge, but like I said, it needs to be on your local network at least, and you have to do some editing in the windows registry, so it has its limitations.
But for the system I am working with, this solution worked perfectly because I have a controlled environment that I can set up all these prerequisites.
So, just to clarify, what I did here is:
Create a chrome extension with background.js opening up the listener to the website's javascript.
Add a registry in windows registry pointing to the path of the executable.
Create the executable in C# doing all your logic.
Send a response from the executable to the extension and then back to the website.
There are several guides on how to do this, so I won't detail these steps here so I don't replicate it.
But for the moment, it is the best way to do what you want, if you have control of your environment that is.
So, if your plugin (extension or chrome app) will work on a controlled environment, this is the way to go, otherwise, I would consider something related to ClickOnce perhaps or WebAssembly but that's not fully released yet.
Chrome own extension manager supports extensions written in js and html.
that said, to execute c# code within the extension you have two options:
Compile c# code to javascript code which then can be added as a normal javascript extension to chrome (take a look at scriptsharp)
Use c# as a back-end system. just like most of download managers:
for case 2 you need a c# application installed in client device(or in the cloud) listing to a specific port (using httplistener or self hosted webapi (you can use netcore) which do these steps
Listing to incoming requests
parse request data eg. json and do something with it
return the result to javascript extension which can display it to user or do other things with it.
The topic is quite old, but I'd like to share that sample:
https://github.com/Retyped/Demos/tree/master/ChromeDemo
In a few words, the sample is implemented in C#. The Retyped.chrome NuGet package provides bindings (Chrome API) for Bridge.NET projects. So yes, now you can implement your logic in C#, then C# code will be transparently compiled into JavaScript by Bridge.NET compiler.
With that approach you can build your Chrome extension on top of .NET Framework as well as utilize thousands of JavaScript libraries.