|
No process is started when you drag an executable - or any file - to the Solution Explorer. You're simply dragging and dropping a file. Again, there is no process created.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I don't think you're following me. I was tallking about doing something like this:
using System;
using System.Diagnostics;
using System.ComponentModel;
MyProcess myProcess = new MyProcess();
Process.Start("IExplore.exe", "www.northwindtraders.com");
Any tips on what data structure I should use to hold me email prior to redirecting my executables standard in?
|
|
|
|
|
No, I'm afraid you're not making any sense. Your subject is "[VS .NET] Drag & Drop into Solution Explorer?" which has nothing to do with what you're asking now. When you drag and drop a file into the Solution Explorer you merely copy the file.
Now you're asking something entirely different. You don't need to add the process to your solution to run it using Process.Start . You only need to reference the correct path of the executable or just the name if the parent directory of the executable is in the PATH environment variable.
You don't use "data structure"s to redirect standard in. If you want to know how to do this, you should read the documentation[^] for ProcessStartInfo.RedirectStandardInput in the .NET Framework SDK. I will tell you, though, that Internet Explorer is a GUI application that does not output to standard output or error, or read from standard input.
And what does this have to do with emailing anything?
Please try to be clear. Your original post only said that you copied a file to your solution, which - as I've stated - is nothing more than copying the file to the solution or project directory. You DO NOT need to add an executable to your project.
For example, the following source - compiled with "csc.exe /t:exe sourcefile.cs" - starts Calc.exe. You don't even need a VS.NET project for it - just use the C# command-line compilers in %WINDIR%\Microsoft.NET\Framework\v1.1.4322 (or whatever version directory is installed for whatever version of .NET you have installed):
using System;
using System.Diagnostics;
class Example
{
static void Main()
{
Process.Start("calc.exe");
}
} No project, no copying calc.exe to a solution or project - just simply starting a program that exists in a directory reference in the PATH environment variable.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi,
I was wondering if anyone has figured out how to get the new Windows XP-stype ballon-tip to appear in a Tray icon type application written in C#?
The NotifyIcon object doesn't have any properties or methods to allow for that and I just can't figure out how to do it.
Does anyone have any ideas?
Thanks.
|
|
|
|
|
|
|
I am a new programmer! I have a little experiences of C# language. Can you give me some advice to learns this language well.
Thank you very much
Hello Informatics World
|
|
|
|
|
Hi,
You can learn c# 2.0 as it will be release any sooner probably this year.
Learn the C# features - e.g generics.
Learn how to use OOP + Design Patterns (Singleton) in C#.
Learn .NET Coding Best Pratices when you coding C#. Well there is a tool called FxCop. It will help you to analyze your code. It is quite useful.
Best to learn to walk before running.
Hope it helps. Cheers.
Regards,
Chua Wen Ching
Visit us at http://www.necoders.com
|
|
|
|
|
Hi,
Is it possible to wrap a dll A into another dll B, so I just need to distribute the dll B, but not the dll A? And how are there differences in
the following cases ?
1. the dll A is written in VC++, and the wrapping dll B is written in C#
2. the dll A is written in C#, and the wrapping dll B is written in C#
My concern is that I don't want others to get the original dll B when I distribute
the program. So can other people reverse engineer the wrapped dll and get the original dll out ?
Many thanks
|
|
|
|
|
No, that's not possible.
Something like this can only be done with static libraries that are linked with an executable.
With dlls you don't get code copied or linked directly, but only references to external functions.
That's the whole point of using dlls.
mav
|
|
|
|
|
Maybe you can buy an enterprise version of obfuscation and then obfuscate your assembly. It might confuse the crackers when reverse engineering your assembly.
And i don't think you achieve with what you want.
Cheers.
Regards,
Chua Wen Ching
Visit us at http://www.necoders.com
|
|
|
|
|
There is a messy way of embedded B.dll in A.dll as an embedded resources, extracting it using Assembly.GetManifestResourceStream , and then loading it into the AppDomain using several different methods depending on how you extract it or to where you extract it...but that's just dumb.
Why? For one, it creates a servicing hastle. Now you have to patch both by virtue of patching A.dll. Also, anyone else can extract it using outside code.
If you're worry about disassembly or decompilation, then you picked the wrong language. .NET languages and Java both compile to intermediate code (.NET to Intermediate Language (IL), and Java to bytecode). Even if you obfuscate it some can deobfuscate it just as easily.
If you truly want to hide an implementation, then you'll need to put that functionality into a native DLL (which still isn't impossible decompile, though extremely difficult expecially when optimized) and use P/Invoke or COM interop, which you can read more about in Interoperating with Unmanaged Code[^] in the .NET Framework SDK.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi , I am trying to liken the ListView to a dataGrid..
Lets say we have a dataTable and a ListView..
In order to simulate dataGrid , we would like to known how many colums do we have , before binding the items into the ListView , I create the columns...
<br />
for ( int j =0 ;j<dTable.Columns.Count;j++)<br />
{ <br />
this.listView1.Columns.Add(dTable.Columns[j].ColumnName,-1,HorizontalAlignment.Center);<br />
}
Then , I consider to bind each dataRow into the ListView with the corresponding columns..
<br />
for ( int i = 0 ; i<dTable.Rows.Count;i++)<br />
{<br />
this.listView1.Items.Add(dTable.Rows[i][0].ToString());<br />
for ( int j =0 ;j<dTable.Columns.Count;j++)<br />
{ this.listView1.Items[i].SubItems.Add(dTable.Rows[i][dTable.Columns[j].ColumnName].ToString());<br />
}<br />
}<br />
Do you have any idea what I am doing wrong ?
|
|
|
|
|
You're adding the column name over and over again ?
It would help if you said what is actually GOING wrong. Why are you using a listview if you want a datagrid ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks for the reply ,
May be because of the style of the text , you cant see right , I only add the columns to the listView in the first loop, then I add values to those columns..
well it seems like , the values are ok , by this code..But I guess , I made the ListView nervous , treating like a dataGrid.May be you are right, I was just looking for fun , and develop some UI skills...
<br />
StringBuilder s = new StringBuilder();<br />
foreach (ListViewItem li in this.listView1.Items)<br />
{<br />
s.Append(li.Text);<br />
for(int k =0;k<this.listView1.Items[li.Index].SubItems.Count;k++)<br />
{<br />
s.Append(this.listView1.Items[li.Index].SubItems[k].Text);<br />
s.Append("-");<br />
}<br />
s.Append("\n");<br />
s.Append("------------------------");<br />
s.Append("\n");<br />
}<br />
<br />
MessageBox.Show(s.ToString());<br />
|
|
|
|
|
ok , At last I found the reason, ColumnHeader Collection can not be work with listView(or I cant do it)
<br />
ColumnHeader [] h = new ColumnHeader[ColumnCount];<br />
<br />
for (int i=0;i<ColumnCount;i++)<br />
{<br />
<br />
h[i].Text=dTable.Columns[i].ColumnName;<br />
<br />
}<br />
this.listView1.Columns.AddRange(h);<br />
After I declare ColumnHeader one by one , it works fine..
Do you see any syntax or algorithm errors in Column Header Collection that I created?
|
|
|
|
|
it's not a collection, its an array as you have created it using array syntax.
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Because I need to use printPreviewDialog as preview only.
Pls show me the code to fix it.
Regard
Panthep
|
|
|
|
|
'Remove\Hide the print button.
Dim Strip_ToolStrip As ToolStrip
Strip_ToolStrip = Print_PrintPreviewDialog.Controls("ToolStrip1")
Strip_ToolStrip.Items("PrintToolStripButton").Available = False 'Remove
Strip_ToolStrip.Items("PrintToolStripButton").Enabled = False 'Hide
|
|
|
|
|
Thanks this approach worked, here is the code for C#
System.Windows.Forms.PrintPreviewDialog printPreviewDialog = new System.Windows.Forms.PrintPreviewDialog();
System.Windows.Forms.ToolStrip toolStrip = (System.Windows.Forms.ToolStrip)printPreviewDialog.Controls["ToolStrip1"];
toolStrip.Items["PrintToolStripButton"].Available = false;
Thanks
Saravanan J
|
|
|
|
|
How to I can get the rows selected in dataGrid when user make muli-selection on dataGrid.
Regard
Panthep
|
|
|
|
|
For x As Integer = 0 To Me.BindingContext(Datagrid1.DataSource).Count - 1
MsgBox(String.Format("{0} {1}", x, Datagrid1.IsSelected(x)))
Next
done
|
|
|
|
|
Hi,
I'm interested in learning how to retrieve CD information from a CD Drive in C#. I really only require the volume ID, to begin with. I suppose I can learn the rest myself once I've taken the first step.
Can anyone tell me the best way to learn how to do this?
eg.
- DLL References
- Classes
- Other URLs to sources that explain this
Many Thanks!
Tim
|
|
|
|
|
Sorry, I meant TOC, not volume ID
Cheers,
Tim
|
|
|
|
|
I have the following problem: i was trying to write a simple console application where the user enters a number and the program must show that number, as you can see is VERY VERY SIMPLE! but when the user enters the number, C# takes a wrong number, and gives that as the answer, here's an example of the code:
int i=0;
console.writeline("Enter a number: ");
i=console.read();
console.writeline("Your number is {0}",i);
i don´t know what the problem is, cause as far as i know I'm using a method that works for that!
Can anybody help me, please?
|
|
|
|