|
Hi Sebastian!
The compiler says! Well the method just call execute file!!! Nothing more!
private void executeFile(TreeNode nodeCurrent)
{
Process.Start(getFullPath(nodeCurrent.FullPath));
Process.Start(String.Format("\"{0}\"", getFullPath(nodeCurrent.FullPath)));
}
private void lvFiles_SelectedIndexChanged(object sender, System.EventArgs e)
{
executeFile(nodeCurrent);
}
I tried to use shell dll too! But a little bit lost with it....
I know that I maybe doing something wrong but... I´m more familiar with structured C.
|
|
|
|
|
Well,
where is nodeCurrent declared for lvFiles_SelectedIndexChanged? That's why the compiler says that there is no nodeCurrent...
You have to get it the current selected item from your listview. Something like:
lvFiles.SelectedItems[0]
By the way, are you using a TreeView or a ListView control?
Regards
Sebastian
|
|
|
|
|
It´s using both!!!! But treeView shows only folders ald list view only files!! I liked this way because it keeps wiewing more organized!
I tried another method BUT I´m also trying this
nodeCurrent is used to popuate lvFiles with files... it gets the current node and shows files. getFullPath gets the path from the root to the current node...
I tried shell too you might see it because it almost worked.. just for the detail that it opns the program but not the file (I know that I´m missing a line or some statement) I´m lost because it´s my first c# experience!!!!
|
|
|
|
|
First, it's not good practice to pass a TreeNode object to a method called "executeFile". It's kind of counter-intuitive. You should be passing in a string decribing the full path to a file. "executeFile" shouldn't need an entire TreeNode to do it's job.
Now, what does getFullPath return when you pass in a TreeNode??
|
|
|
|
|
Hello Dave!!!
getFullPath returns the path from the root to the current node!
Yeah it makes sense to me now!!! It´s totally silly to pass something that is pointing to a directory to execute a file.... It doesn´t needs to know WHERE THE FIE IS because it is already showing me the files!
I´m beginning to understand!
|
|
|
|
|
Hi Sebastian
I just tried another method that is ALMOST working!! Just a tiny detail that it open the program by doubleclicking the file BUT it doesn´t open the file itself!!!
private void lvFiles_SelectedIndexChanged(object sender, System.EventArgs e)
{
ShellLib.ShellExecute shellExecute = new ShellLib.ShellExecute();
shellExecute.Path = @"C:\Arquivos de programas\AutoCAD 2008\acad.exe";
shellExecute.Execute();
}
just a simple shell dll command!
Now I need to open the file itself!!! Any clue???
tnx!
|
|
|
|
|
Hello folks!
I´m almost reaching what I wanted to do! Now It does open the file... BUT JUST that file specified in the path on the code as you will see right down!
private void lvFiles_SelectedIndexChanged(object sender, System.EventArgs e)
{
ShellLib.ShellExecute shellExecute = new ShellLib.ShellExecute();
shellExecute.Verb = ShellLib.ShellExecute.OpenFile;
shellExecute.Path = @"F:\Painel de Controle ETECH\Projetos ETECH\Acessórios\80010005.dwg";
shellExecute.Execute();
}
It will open ONLY 80010005.dwg
"Projetos ETECH" is the root node (folder) and contains a lot of childs (subfolders of especific projects) wich contains CAD drawings (thousands millions of DWGs). I need a way to get the path of any selected file. What I thought was to create a method that gets the path where you are and the name of the file you selected (string) and put them together to for the path to te file to be executed...
Am I in the right way or there is something easier????
Best Regards for all you!!!!
|
|
|
|
|
Hi,
it's me again. Sry, for didn't answering yesterday, was on my way home.
Okay, so opening the file is not the problem. The problem is to get the path and name of the file to open. So let me guess that you doing something like this.
public string getFullPath(string sPath) {
string sFileName = lvFiles.SelectedItem[0].Text;
return System.IO.Path.Combine(sPath, sFileName);
}
private void executeFile(TreeNode nodeCurrent)
{
Process.Start(getFullPath(nodeCurrent.FullPath));
Process.Start(String.Format("\"{0}\"", getFullPath(nodeCurrent.FullPath)));
}
If you are doing this, you get an error from the compiler? Did you include the Namespace (using System.Windows.Forms)? Or rewrite it to
private void executeFile(System.Windows.Forms.TreeNode nodeCurrent) {
...
}
Does this solve your problem?
Regards
Sebastian
|
|
|
|
|
I've received a DLL written in VB.NET to use in my C# application.
I can add a reference to the DLL in my C# app; and can also initiate an object of a class.
Now is the problem that i can't see the properties of this class in C#; while i can see them in VB.NET ( their all public).
Anyone any suggestions how to solve this?
Thanks in advance
|
|
|
|
|
What I have Done :
1: Create A Solution and Create a Windows Application in C#.
2. Right Click On Soluntaion -> Add New - > Class Library ( Choose Langauge as VB.NET )
3: Create a Class Library (MyLibrary) in VB.NET
4. Create Class as Class1 and Two Function A1() and A2() as Public.
5. Build The Class Library.
6.Back To My C# Application, Right Click on Reference -> Add -> Projects
Add MyLibrary.Dll
7. in C# code
using MyLibrary;
Now you can Able to Create Object of Class1
Class1 C1=new Class1();<br />
C1.A1()
C1.A2()
Now Try To Following Steps, Hope you will do it. that I have just done it.
cheers,
Abhijit
|
|
|
|
|
Thank you; I've made a conversion class in a VB.NET ClassLibrary1 and i can use the DLL now.
|
|
|
|
|
Are you talking about seeing the descriptions of the methods and properties in Intellisense?? You can still use all the public properties and methods, but, before Visual Studio 2005, the VB.NET compiler didn't support generating the XML files required by Intellisense to populate the descriptions.
|
|
|
|
|
Thank you for the reaction but i didn't use intellisense.
|
|
|
|
|
The process described by the other person is what was used to create the VB.NET .DLL you received. From what you described, he told you how to test the process. Creating another test .DLL doesn't fix the problem.
From what you described, it sounds like the person who wrote the VB.NET .DLL didn't expose the properties you were trying to get to as Public.
|
|
|
|
|
Hello everyone,
When using Visual Studio to add a Web Reference to an https web services, it is fine. And I just need to click to accept some security warning message box.
But when using wsdl command line tool to retrieve the same web services, there is something wrong. Here is the output. Any ideas?
wsdl https:
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.
Error: There was an error processing 'https://127.0.0.1:8080/SystemMonitor?wsdl'.
- There was an error downloading 'https://127.0.0.1:8080/SystemMonitor?wsdl'.
- The underlying connection was closed: Could not establish trust relationship
for the SSL/TLS secure channel.
- The remote certificate is invalid according to the validation procedure.
If you would like more help, please type "wsdl /?".
thanks in advance,
George
|
|
|
|
|
George_George wrote: https://127.0.0.1:8080/SystemMonitor?wsdl
What happens when you access it via browser? I think the error message is clear, isn't it?
|
|
|
|
|
Thanks N a v a n e e t h,
I have tested the well known security warning box displayed and I can select yes to trust the connection and WSDL is displayed.
My question is from command line, why it is not working? Any solutions?
regards,
George
|
|
|
|
|
Hallo all,
I'm using c# and visual studio 05 and I'm rendering in a webBrowser control to render .doc, .xml and mht documents( all from ms word). So the browser shows the document allong with ms word's tools, like coment inserting etc... Is there way to control the document. For example, can I apeear only the first page of the document (some kind of paging)? Also can I get the table of contents and table of figures of the document?
Thanks!!
|
|
|
|
|
how can I write a plugin for IE browser that can handle an specific format? I know how we can write a toolbar for IE, i only have problem with Plugins.
|
|
|
|
|
I haven't tried it. But this[^] looks similar. MSDN[^] also has an article, but it is on VC++.
|
|
|
|
|
Hi,
For a sportevent I need to make to calculate the overall time after each round an this for 15 rounds.
The input and output timeformat is "HH:mm:ss:ff" because I need the millisecond precision.
Maybe it's a stupid question, but I can't figure out how I can do this. Is there someone who can tell me how I make the sum of 2 different times. so I can start from that point.
thanks for the advise.
grtz.
w
|
|
|
|
|
TimeSpan has Add method. Have you checked that?
|
|
|
|
|
You should parse the string into a timespan object
TimeSpan roundOneTime;
bool success = TimeSpan.TryParse("00:12:34.67", out roundOneTime)
You can then easily add the multiple timespan objects together to get your total.
(The format required is "HH:mm:ss.ff" (it's a . not a : before the milliseconds, so you'll either need to parse the string and change it first, or change how the strings are built up.
Simon
|
|
|
|
|
|
Hello,
How to get the different OS names which are used in users system. Like OS is XP or Vista.
How can I get users operating system is XP or Vista when I am using windows programming?
Reply..
|
|
|
|