how to invoke the Shell command with a dotnet assembly
bultela
Member Posts: 6
Hello all,
I am creating inside Navision a calculation engine with a more or less complex structure.
Example, after having calculated the value of all my variables, I get the following expression in a field :
(18*(3/(4+2))*5)/3 +9
The number of brackets can change. It is difficult to do it in Navision;
That's the reason why I had the idea to run the windows calculator (without opening it) to pass in the calc.exe program the expression (example : (18*(3/(4+2))*5)/3 +9) and to get the result (24).
I thought at the shell command which could be run before NAV 2013 with an automation variable.
But I have now to do it with Dotnet;
Does anyaone have an idea of the name of the name of the assembly to use and which syntax can be used to run the calculator with a formula as parameter ?
I woul really an answer from you.
Best regards
M. Bultel
I am creating inside Navision a calculation engine with a more or less complex structure.
Example, after having calculated the value of all my variables, I get the following expression in a field :
(18*(3/(4+2))*5)/3 +9
The number of brackets can change. It is difficult to do it in Navision;
That's the reason why I had the idea to run the windows calculator (without opening it) to pass in the calc.exe program the expression (example : (18*(3/(4+2))*5)/3 +9) and to get the result (24).
I thought at the shell command which could be run before NAV 2013 with an automation variable.
But I have now to do it with Dotnet;
Does anyaone have an idea of the name of the name of the assembly to use and which syntax can be used to run the calculator with a formula as parameter ?
I woul really an answer from you.
Best regards
M. Bultel
0
Comments
-
0
-
Thnak you for the answer;
its works.
I had already seen this post but could not find the assembly system.diagnostics.process.
The reason is simple : I had to select the assembly SYSTEM first and that's all.
there are in the list other assemblies which have quite the same name but not the same.0 -
The only place I know to invoke the "shell" command is from the visual basic core library.
Within the Microsoft.VisualBasic.Interaction namespace is the Shell method, MSDN here http://msdn.microsoft.com/en-us/library/f92d6y8s(v=vs.110).aspx?appId=Dev11IDEF1&l=EN-US&k=k(Microsoft.VisualBasic.Interaction.Shell)%3bk(TargetFrameworkMoniker-.NETFramework,Version%3dv4.5)%3bk(DevLang-VB)&rd=true&cs-save-lang=1&cs-lang=vb#code-snippet-1
Using this method you can create a process without using the additional code.
Define two variables:
vbShell of DotNet using Microsoft.VisualBasic.Interaction.'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
vbAppWinStyle of DotNet using Microsoft.VisualBasic.AppWinStyle.'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
The C/AL code required is as follows;vbShell.Shell('c:\somedir\somefile.exe', vbAppWinStyle.Hide, FALSE, 0);
Much simpler but less control.
Enjoy 8)0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 329 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
