|
|
hello,
my problem: i like to select multible mp3 files in the windows explorer, open and process them with my application.
I think it works with the GetCommandLineArgs() Methode (bsp. string[] args = Environment.GetCommandLineArgs()). This Method returns a string array. But when i select more than 1 mp3 file in the windows explorer, and show the Length of the args array, it alwas says 2. Index 0 is always the url of my programm. Index 1 is the url of the first selectet mp3 in the windows explorer, and the rest is emty.
But why, i like to get each url of each mp3. I hope you understand me
modified on Wednesday, October 22, 2008 3:08 AM
|
|
|
|
|
That because Explorer only launches your application with one file at a time. Your code is expecting this:
MyApp.exe file1.txt file2.txt file3.txt file4.txt
Explorer is actually launching this:
MyApp.exe file1.txt
MyApp.exe file2.txt
MyApp.exe file3.txt
MyApp.exe file4.txt
Google for "Single instance application c#" for examples on how to deal with this situation and pass the filename from one instance of your app to another.
|
|
|
|
|
Hello i joined here to ask for a little help.
I'm very new to programming (I'm only 15) and have only just learned about classes and methods and instances...
So why am i here?
I want to know about DllImport because i have had absolutely NO PRACTISE with it, and would like to use NTDLL (caps?)
I have no idea what the name is of what i want, but it's stuff like "NtSuspendProcess".
Telling me what it's called will be great, giving examples of NtSuspendProcess will be brilliant (I want to have a go at starting my own project )
Sorry for any hastle (or annoyance... ) and thanks for any help / loving welcomes
|
|
|
|
|
Hi,
first of all I like to welcome you to the fabulous world of programming And welcome to Codeproject (it's okay if I speak for the community?)...
There is a site called PInvoke, which contains the DllImport-syntax for a lot of libraries. For example have a look at the SuspendThread-Method:
http://pinvoke.net/default.aspx/kernel32/SuspendThread.html
And here at stack overflow you get a whole example:
http://stackoverflow.com/questions/71257/suspend-process-in-c
Hope this helps you a bit...
Regards Sebastian
|
|
|
|
|
I put a panel on a form. when the user clicks the panel
a new pictureBox that holds an image is created with a unique name.
Those pictureBoxes are stored in a BindingList declared in code.
How can I make the bindingNavigator shows the number or name of a specific picture when It is clicked so I know for sure i am changing that xyz picture.
|
|
|
|
|
Hello Everyone. Has anyone worked with the ObjectForScripting method before, if so please post a reply as I would like to ask a particular question that concerning this.
Thank You.
|
|
|
|
|
You would be better off just posting your question, rather than asking if anyone knows that area.
Simon
|
|
|
|
|
Hello Everyone,
With regards to working with ObjectForScripting property of a webbrowser control
I have a toolbar that runs in IE when you launch it, there is no webbrowser control added,
I can get to the document of the current browser, but would like to get to the ObjectForScripting property of the current browser that is initialy launched in IE, if possible.
I don't konw it this maybe possible, as I don't think that the browser that is launched when IE is executed, may have this property set, also logicly, since that object would have already been created, then it would be also impossible to set the ObjectForScripting property after the object has already been initialized.
I am just puttiing this question out there, so that someone else can confirm this or prove some other way to accomplish this, as that would save me a lot of work on having to rewrite already created javascript functions into managed code, where I would have been able to execute javascript functions against the intial document, client Side, and have the client script call managed application code for my toolbar loaded in IE, without having to recreate a browser app and implementing a webbrowser control, just to be able to use OBjectForScripting.
Please note that this is not a .Net solution, and there will be no running scripts against the server.
Once again, Thank you all.
|
|
|
|
|
If it's not a .NET solution, then why are you posting it here? This seems like a very odd forum to post a none .NET question.
|
|
|
|
|
This google search might help[^]. Take a look around the MSDN links
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Guys, I am trying to do the following but I get some conversion errors. can someone help me please?
Class:
public class Widget
{
public string RSP = "";
public int WidgetOrDiscount = 0;
public decimal Price = 0.0m;
}
Console apps:
static void Main(string[] args)
{
//LinkedList<System.String> myList = new LinkedList<System.String>();
LinkedList<Assignment3.Widget> myList = new LinkedList<Assignment3.Widget>();
PopulateData(ref myList);
}
private static void PopulateData(ref LinkedList<Widget> myList) {
//record 001
Widget wdg1 = new Assignment3.Widget();
wdg1.RSP = "R";
wdg1.WidgetOrDiscount=150;
wdg1.Price=1.00m;
myList.AddFirst(wdg1);
//record 002
Widget wdg2 = new Assignment3.Widget();
wdg2.RSP = "R";
wdg2.WidgetOrDiscount = 130;
wdg2.Price = 2.00m;
myList.AddAfter(wdg1, wdg2);
//record 003
Widget wdg3 = new Assignment3.Widget();
wdg3.RSP = "S";
wdg3.WidgetOrDiscount = 145;
wdg3.Price =0.00m;
myList.AddAfter(wdg2, wdg3);
//record 004
Widget wdg4 = new Assignment3.Widget();
wdg4.RSP = "R";
wdg4.WidgetOrDiscount = 50;
wdg4.Price = 2.50m;
myList.AddAfter(wdg3, wdg4);
}
Please help me.
|
|
|
|
|
AddBefore and AddAfter require list nodes as arguments. Whereas AddFirst and AddLast do not.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
can u give me an example with node? does it accepts object type or only string? please help.
|
|
|
|
|
I used addbefore and addafter. how can I loop to display the items in a console app for the linked lists? I see online saying >ForEachLoop but it does not work,
|
|
|
|
|
1st, I think it's better that you write your LinkedList like this:
LinkedList<string> ll = new LinkedList<string>();
LinkedListNode<string> lln = new LinkedListNode<string>(Console.ReadLine());
ll.AddFirst(lln);
LinkedListNode<string> Prelln = null;
while (true)
{
Prelln = lln;
string input = Console.ReadLine();
if (input == "End")
break;
lln = new LinkedListNode<string>(input);
ll.AddAfter(Prelln, lln);
}
It takes less memory. [Edit] However, It's your choice [\Edit]
2nd, a simple foreach gets you your nodes, for this example:
foreach (string i in ll)
Console.WriteLine(i);
While (true) { Human.isLearnable = true; }
modified on Tuesday, October 21, 2008 2:41 PM
|
|
|
|
|
I found some code on the net to allow drag and drop on a grid.
Code can be found at :- http://www.danielsoper.com/programming/DataGridViewDragDropRowsColumns.aspx[^]
Has any one had any experience of using this object? AS I am getting some frustraiting results!
Once I have added my DataSource and DataMember the control will not let me change the names of any of the columns. If I rename Column1 to Name, when I close the properties page it renames its self Column1
I can get round this by renameing the columns in code datagridView2.Columns[0].HeaderText = "Name";
When I run my form the control seems to append a number of blank columns to the begining of my data,
if my data returns 23 columns the grid displays 43 columns
Any help would be appreciated.
|
|
|
|
|
Graham_4 wrote: AS I am getting some frustraiting results!
You apparently did not understand that the page is showing one way to do this. It is not a reusable class. One minute of looking at the code easily finds the following:
protected override void OnColumnAdded(DataGridViewColumnEventArgs e)
{
e.Column.SortMode = DataGridViewColumnSortMode.Programmatic;
<span style="color: Red; font-weight: bold;"> e.Column.HeaderText = "column " + e.Column.Index;</span>
base.OnColumnAdded(e);
}
This clearly indicates that the code is for example purposes, not reuse. I am afraid your plan to copy/paste software development has been upset due to you not having a clue what you are doing. Shocking, no really it is.
led mike
|
|
|
|
|
i want to select that row in true db grid on which mouse right click button is clicked but now i left click button clicked on true db grid it will select that row but with the right click it doesnot select the row.
i want to select the row of grid with both right and left click buttons of mouse
thanks & Regards
Tanvir.
dasda
|
|
|
|
|
Best bet is to try the vendor's website - or fire the left click event when the right button is clicked?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Anyone know if there's code out there for generating a paginated interface like Word, with a drawing area the size of the page selected in the printer settings?
|
|
|
|
|
I don't know if it will help in your context but I think there is a print preview control available in .NET for Windows Forms.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
In VB.net when we define DaySel as:
Dim DaySel As Date then when we use the command totaldays = DaySel.DaysInMonth(DaySel.Year, DaySel.Month)
it will response the corresponding days of the selected month (28 or 29 or 30 or 31 days)
However when I define in VC#
System.DateTime DaySel = default(System.DateTime);
- I only can get DaySel.DayOfWeek or DaySel.DayOfYear
Anyone can show me how to get the total days of the selected month?
Thank for nay help
|
|
|
|
|
//
// Summary:
// Returns the number of days in the specified month and year.
//
// Parameters:
// year:
// The year.
//
// month:
// The month (a number ranging from 1 to 12).
//
int daysInMonthCnt = System.DateTime.DaysInMonth(int year, int month);
|
|
|
|
|
The DaysInMonth is a static method, so you use the class name to call it, not a variable instance:
DateTime.DaysInMonth(DaySel.Year, DaySel.Month)
I don't know the exact reason why you can call static methods using a variable instance in VB, but it's not very logical.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|