|
Hi everyone,
Thank you, you all have really helped expand my knowledge on string formatting.
|
|
|
|
|
can anyone help me to get window using process thread
SUCIL
|
|
|
|
|
You can use this to get an instance to the current thread:
Thread _currentThread = Thread.CurrentThread
Cheer's,
Alex Manolescu
|
|
|
|
|
Are you looking for the main form in your own application ?
A main window in a different application?
Is the other process a .NET application?
Please explain
|
|
|
|
|
I assume that you want to get the window handle from a thread id. To do that, I would:
- Pass the thread id to GetProcessIdOfThread() to obtain a process id
- Because a process can open multiple windows, you need to return a collection. Iterate every window, getting their process ids. If it matches the id from 1., then add the window handle to the collection
|
|
|
|
|
i m try to save a file but it does not work
can anybody suggest me some good tectics using C# codings
|
|
|
|
|
public void copyBookDatabase()
{
string filename ="mydb.mdb";
string destfileName = filename;
string sourcePath = Environment.CurrentDirectory;
string targetPath = @"C:\DB_Backup\";
string sourceFile = System.IO.Path.Combine(sourcePath, fileName);
string destFile = System.IO.Path.Combine(targetPath, destfileName);
System.IO.File.Copy(sourceFile, destFile, true);
}
hope this helps
|
|
|
|
|
tanweer akhtar wrote: i m try to save a file but it does not work
Are you getting an error?
If yes, post the error here and someone might be able to help you.
|
|
|
|
|
hello to all
i m a student
i m interested in C#
i have a problem now
i m aunable to use the '\' or "\" in my program how i can use it in C#
can any body help me
thank lords!!!!!!!!!
best reguards >>>>>>
|
|
|
|
|
|
I think the type of '\' is character,the type of "\" is string
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:51am.
|
|
|
|
|
Basically lets say you have 3 items in an array[]
is there a way to do something like this
for (int i=0; i< array[].length; i++)
{
string Name + i = blahblah.tostring();
basically so I would have 3 strings
Name1
Name2
and Name3
|
|
|
|
|
Not that I konw of.
You could use a dictionary<string, string> where the key is the "name
of the variable".
something like:
Dictionary<string, string> blah = new Dictionary<string, string>();
for (int i = 0; i < array[].length; i++)
{
blah.Add("Name" + i.ToString(), "blablablah");
}
|
|
|
|
|
If they are fields/properties instead of local variables you could do something like that with reflection, but you really shouldn't.
|
|
|
|
|
Well what I was thinking is since my current code is giving me an issue with resetting the dataset inside a foreach loop I was gonna do the following to populate a tree view.
string[] AuthorNames = new string[bookdbDataSet.Tables[0].Rows.Count];
int row=0;
foreach (DataRow Row in bookdbDataSet.Tables[0].Rows)
{
AuthorNames[row] = Row["AuthorFirst"].ToString() + " " + Row["AuthorLast"].ToString();
TreeNode [DYNAMIC NAME HERE] = new TreeNode(Row["AuthorLast"].ToString() + ',' + Row["AuthorFirst"].ToString());
rootNode.Nodes.Add(tn);
row++;
}
for (int counter = 0; counter < AuthorNames.Length; counter++)
{
string[] splitarray = null;
string Aname = AuthorName[i].tostring();
splitarray = Aname.split(" ");
bookListTableAdapter.FillByFirstandLast(bookdbDataSet.BookList, SplitArray[1].ToString(), SplitArray[0].ToString());
foreach (DataRow ChildRow in bookdbDataSet.Tables[0].Rows)
{
TreeNode child = [DYNAMIC NAME HERE].Nodes.Add(ChildRow["Title"].tostring());
}
[DYNAMIC NAME HERE].nodes.add(child);
}
So basically I get all the unique author names first and put them in an array
Then I fill the dataset one at a time for each author and then run a foreach to get the titles and then I assign them to the node of the Rootnode's dynamic name
|
|
|
|
|
Well clearly you can't do that, even if "dynamic names" were possible they would go out of scope..
Idea 0: Why don't you just fill and array with them?
Idea 1: Couldn't you nest the loops? Then you would only need 1 temporary variable to hold the current TreeNode.
|
|
|
|
|
well, here is what i was originally thinking but of course I can't do the second fill with the foreach. Thats why I went a different route. I'm sure I'm doing this all wrong but hey I'm learning so what the heck...
http://csharp.pastebin.com/m58597462[^]
|
|
|
|
|
Why can't you do that? As far as I can see you're not changing the collection that the foreach loops over
|
|
|
|
|
Hi all, i'm asking how to use a socket class to listening to all ports and reciving all packets...
Regards
|
|
|
|
|
i think if you make (for) loop to make threads of all ports
|
|
|
|
|
If any one know then guide me.
|
|
|
|
|
|
Actually i made a window application , in which play a video file using window media player. now i want to take a snapshot image. the link you tell me its all about Webcam Service.aspx. i am not working in aspx. so do you have any idea how can i take snapshot using window media player api.
|
|
|
|
|
I don't kownw!
But by using either of WPFMediaKit[^] or Slimdx[^] you should be able to gather more information...
Who knows they might even have a sample.. or they might know if you ask on their discussion list?!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Hi all
I have a C header file which describes a plug-in interface. Now, I'd like to implement plug-ins in C#. How would I go about doing that?
The interface uses C native types including callback functions.
Any tips or pointers?
Thanks in advance
Niklas
|
|
|
|