ASP.NET Assembly -IL to Source - asp.net

Ofcourse the IL is lanuage independent,can i get the source code back from IL (let the source code be any language C#,VB) ?

You could use .NET Reflector and Denis Bauer's Reflector.FileDisassembler:
The Reflector.FileDisassembler is a
little add-in for the new version of
Lutz Roeder's .NET Reflector that you
can use to dump the decompiler output
to files of any Reflector supported
language (C#, VB.NET, Delphi). This is
extremely useful if you are searching
for a specific line of code as you can
use VS.NET's "Find in Files" or want
to convert a class from one language
to another.

Yes, to an extent, http://www.red-gate.com/products/reflector/.

Use
MSIL Disassembler (Ildasm.exe)

yes, you can using ILDASM.exe
http://msdn.microsoft.com/en-us/library/f7dy01k1%28VS.80%29.aspx

Related

Call java method from the microsoft docx document

I want to call the one of java method of my java class file from the Microsoft docx type document?
Is there any simple and stable solution available for this ?If anybody having idea on this can you please share it with me?
Thanks in advance
Yatin Baraiya
Microsoft Language for MS docx is Visual Basic, you can't natively call java methods.
You could also execute a shell command to do what you want:
retValue = Shell("command", vbNormalFocus)
Found on How can I execute a shell command using VBA?
One way to do it would be to use IKVM to convert your Java code to a DLL, and to invoke that from say a VSTO Word add-in.
Another way would be to convert your Java code to a web service (SOAP or REST), and call that, either from a Word Add-In, or VBA (ie a Word macro). For SOAP, see for example http://jamesecampbell.blogspot.com.au/2012/11/how-to-consume-web-service-in-microsoft.html

How can I use Opus-Codec in my Java Application

I read a lot about opus-codec but I am not understanding how can I use that in my sample java application.
Is there any .so file available for opus which can be used?If not then how?
There is currently not yet (at time of writing) any native Java library for Opus.
The Jitsi project is a Java-based VOIP and chat client which has Opus support. This is implemented by using a binary libopus library with a Java wrapper.
You would need to use JNA to create a wrapper around libopus that you can call from Java. I have done something like that in C#: http://opusdotnetinvoke.codeplex.com/
It should be easy to rewrite that C# code into Java.

Tool in .NET with source code to create and manipulate xml file

I want a web application in ASP.NET(any version below VS 2010) in which i can create a xml file and edit its node and enter values and save that modified xml.
Somewhat similar to the tool found at below link:
http://finaldownload.com/components_libraries_xml_viewer-23601-download.html
Use the builtin XMLReader/XMLWriter in .NET.
Examples:
http://www.stardeveloper.com/articles/display.html?article=2009030701&page=1
http://www.xmlplease.com/create-xml-writer
https://web.archive.org/web/20210323155432/http://www.4guysfromrolla.com/articles/092403-1.aspx
http://www.google.com/search?q=asp.net+read+write+xml

ASP.NET - script and css compression

Is there any native compression (for javascript/css files) available in ASP.NET?
Try Chirpy. It mashes, minifies, and validates your javascript, stylesheet, and dotless files.
You can use YUI Compressor or Google Closure Compiler.
http://chirpy.codeplex.com/
Or, for more info, check out:
http://www.weirdlover.com/2010/05/22/visual-studio-add-in-for-dotless-js-and-css-files/
In the appendix of Professional ASP.NET 3.5 Scott Hanselman talks about Packer for .NET. This will integrate with MSBuild and pack javascript files for production deployments etc.
You could use Packer.
This utlity supports JavaScript compression and /or "minifying", and CSS "minifying".
It's available as a command line utility or also as an MSBuild task.
This way you can integrate it into your build process / Visual Studio project.
There is Gzip/Deflate compression support in IIS compatible with all modern browsers except IE6. For IIS 7 check this page: http://www.iis.net/ConfigReference/system.webServer/httpCompression
Further to other answers and comments, you can use Yahoo!'s YUI Compressor and make it an MSBuild Task to integration it into your build and deployment process.
Try StyleManager for CSS combination and minification. It uses YUI Compressor under-the-hood.
Its usage is a lot like asp.net's ScriptManager, so it's quick to get used to. It's easy to add to your project too, only takes a minute.
Most importantly - it combines your CSS files too. So instead of having like 10 CSS files to download it'll just be 1, which will also be compressed etc.
I have written something to do this for me, you can download it here:
http://www.picnet.com.au/blogs/Guido/post/2009/12/10/Javascript-runtime-compilation-using-AspNet-and-Googles-Closure-Compiler.aspx
It uses Google's closure compiler which is pretty awesome.
Thanks
Guido
Here is my way:
Use MVC.
Process js|css content via MVC controller's actions.
Combine multiple files into one.
Minify and obfuscate script|css on fly before it stored in cache.
Cache results.
Use CacheDependency.
Enable gzip for dynamic content.
Enable gzip before cache feature.
Everything can be done just by adding custom attributes on action methods, using ASP.NET MVC Js/Css Composer/Compressor.
Sample:
public class JsController : Controller
{
[Utility.Processors.JsCompress]
[OutputCache(Duration = 3600)]
public ActionResult Jquery()
{
return View();
}
}
You can derive from CustomTextPostProcessingAttribute and make your own postprocessing for any type of text content, you need.
I just learned something today: you can run JavaScript via windows console. I'm a fan of cssmin.js; so, this plus windows console = win! All you have to do is download cssmin.js, put it in a folder on your web project and add the following post-build event in Visual Studio:
type "$(ProjectDir)css\*.css" | cscript //NoLogo "$(SolutionDir)tools\cssmin.js" > "$(ProjectDir)css\core.min.css"
Doing this keeps you from having to edit your project as ajaxmin would have you to do.

System.Web.dll references System.Windows.Forms?

I heard from a friend that asp.net relies on/uses a Windows forms class. I tried to figure out which class that might be.
The only class I found was System.Web.UI.WebControls.FontInfo
with the property public string[] Names
that has an Attribute Editor("System.Windows.Forms.Design.StringArrayEditor--snip")
Is there a reference to the Windows.Forms.dll from System.Web.dll?
I think there is a reference from System.Web, Version 2.0.0.0 to System.Windows.Forms.
Check out System.Web.Compilation.ResXBuildProvider.GetResourceReader(Stream) in Reflector.
On line one: ResXResourceReader reader = new ResXResourceReader(inputStream);
ResXResourceReader is from System.Windows.Forms, Version 2.0.0.0
I was curious because I noticed System.Windows.Forms in the loaded modules window in Visual Studio.
ildasm System.web.dll /out =System.Web.il let me quickly search for System.Windows.Forms references. I couldn’t quickly figure out a way to do it from reflector.
There is no reference, and not System.Windows.Forms either.
The StringArrayEditor is a UITypeEditor in the System.Design assembly. This does not get loaded unless used except at design time, when it will be 'lazy-loaded'.
First of all, I am not sure such an existence.
But Namespace or classname doesn't necessary mean you need a reference to Windows.Forms.dll. You can define "System.Windows.Forms.Design.StringArrayEditor" in an assembly outside Windows.Forms.dll.
If you look at the System.Web assembly in the handy Reflector tool, you will see that there is indeed a reference from System.Web to System.Windows.Forms. However, if you use one of the plugins for Reflector that will export the reverse engineered code to files (e.g. FileGenerator), and then search through that, there is no actual use of System.Windows.Forms. Since the .Net runtime will only load assemblies when they are actually needed, the WinForms assembly should never actually be loaded through any usage of System.Web.
Add me to the list of skeptics. But more importantly, it doesn't matter. The way the .Net framework is set up for linking adding or removing a dependance on any of the core assemblies that ship with the framework won't really impact performance in any meaningful way.

Resources