|
Hello Sir, I m Dnyanesh...! sir i write this message personally to you...! i have found much more suggestion and solution from your site..! i really appriciate of it! but now i have a one conclusion about my windows application...!
my problem is same that where u did gave me solution before! but its heavy to work!
sir i have a windows application in c#.Net and there are uncountable controls..! and now for me its not possible to set the every controls property Dock and Anchor! so sir is there any other solution to set the every controls property Dock and Anchor at one single time or any .dll file which can i easily add to make chages for resizing my form with controls..!
please sir give me a appropriate suggetion or
solution for my problem...!
i am waiting sir of your reply..!
|
|
|
|
|
You can always do this via code.
Something like
foreach (Control item in this.Controls)
{
item.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
}
In this way you dont need to set the properties for each control.
|
|
|
|
|
Abhinav's solution will work, but it will set the anchor to the same for all controls.
Did you know you can select multiple controls in the VS Designer by dragging a rubber band line around them, starting in a blank bit of the form? And that any property changes made to a multiple selection affect the whole group? This includes the Anchor property.
However, I would try to organise my controls better for the users sake, using maybe Tab controls, or similar - if you as the designer can't work with that many controls, how do you expect the user to cope?
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
This is the second repost of an original question posted Jan. 12 on QA [^].
I answered the first repost question here: [^], and mentioned the same information provided by Original Griff in his answer here.
Because of the re-posting, and ignoring a previously accepted answer, I will, reluctantly, "vote" to remove this message.
sorry, Bill
"The first principle is that you must not fool yourself, and you are the easiest person to fool." Richard Feynman
|
|
|
|
|
I am sorry sir..! i will not behave like foolish in future..! but there were something wrong so that's why i did asked to get a new suggestion from your site that was only my intention..!sorry sir if you hurt! please forgive me!
|
|
|
|
|
Hi,
It's my first SubReport, and Iam trying to make some RDLC -Subreport. Can anybody can show me the further steps...?
The below code is for main report... But I want to display this report (For_RDLC_Check_Appln.Check_Report1.rdlc) and subreport in reportviewer...
Is it possible? Any sample cods for Subreport ?
Thanks
<pre>reportViewer1.RefreshReport();
Microsoft.Reporting.WinForms.ReportDataSource ReptRDS = new Microsoft.Reporting.WinForms.ReportDataSource();
ReptRDS.Name = "DataSet1";
ReptRDS.Value = MyReptDataTable;
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.DataSources.Add(ReptRDS);
reportViewer1.LocalReport.ReportEmbeddedResource ="For_RDLC_Check_Appln.Check_Report1.rdlc";
reportViewer1.SetDisplayMode(Microsoft.Reporting.WinForms.DisplayMode.PrintLayout);
reportViewer1.RefreshReport();
reportViewer1.Visible = true;
|
|
|
|
|
|
Sorry for the delayed reply....Thankyou ThatRaja
|
|
|
|
|
Hi,
I create a Com add in Excel. I have the same method in two version: the first use TLP lib for a loop, the second the standard sequential loop.
I have a 4 processor pc. I'm using Excel2003. I see that the performance of TLP version is better in term of time consuming.
Can you confirm can I can transfer C# TLP advantage using COM add in? I thought that even if I have a parallel thread code in my ADD in, in excel it will work in sequential way. I thought it was like to run a code using TLP on a single processor PC. Probably I was wrong.
Can you confirm?
Thanks for your time
|
|
|
|
|
hello guys... I was thinking if it was possible to get the login and logout time of the particular windows user and store that on a text file? A windows service could be one of the choices for this purpose.
I have tried few queries on google but could not find a right direction.
|
|
|
|
|
The Win32_LogonSession class[^] can help you get some information.
|
|
|
|
|
Thanx...it helped
|
|
|
|
|
You are welcome.
Vote if it helped.
|
|
|
|
|
Hi,
I have an entity which Id, Code, Description, from the collection of this entity I want to get the max value of Id.
Is there any method or Linq query to get that? Please help me either by giving code snippet or links.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
|
By "entity" do you mean a Class, a Struct, or ... ?
"Our life is a faint tracing on the surface of mystery, like the idle, curved tunnels of leaf miners on the surface of a leaf. We must somehow take a wider view, look at the whole landscape, really see it, and describe what's going on here. Then we can at least wail the right question into the swaddling band of darkness, or, if it comes to that, choir the proper praise." Annie Dillard
|
|
|
|
|
Hi,
I need to output netstat -ao to a SQL database. I have seen many sites/forums on ways to capture this info using the Process method as well as the IPGlobalProperties methods native to .NET.
While the IPGlobalProperties methods work very well there is no method that I have found that can get the process pid associated with each open port.
I have stripped EASY SOCKET V3 found here http://files.codes-sources.com/fichier.aspx?id=11430&f=easy_socket\iphelper.cs[^]but am not sure how to get the information out. The stripped code compiles but when I run the code from a c# Console application the console pops up and then closes almost immediately.
The stripped code is here http://pastebin.com/yVzrqcJX[^] if anyone is able to help.
Thank you in advance.
|
|
|
|
|
CCodeNewbie wrote: ways to capture this info using the Process method
Did that work? If not, what happened?
|
|
|
|
|
I have no problem executing NETSTAT and capturing its output through the Process class, with redirected outputs, done properly (i.e. with 2 extra threads, using Read, not ReadTillEnd or whatever it is called). Works fine, e.g. on .NET 2.0 and Vista.
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|
|
Do you get PIDs with your netstat? Can you pull each item individually? What I mean is could you do something like (please pardon the pseudo-code)
foreach entry in netstat
proto = protocol
LocalIP = Local Address
LocalPort = LocalIPPort
RemoteIP = Foreign Address
RemotePort = RemoteIPPort
State = State
PID = ProcessID
I was trying to use a streamreader writing to a stringbuiler.appendline but I kept getting the whole list instead of individual entries
|
|
|
|
|
Perhaps use a Regular Expression:
C:\Projects\Utilities>regex "^(?'Proto'\S+)\s+(?'LocalIP'[^:]+): ( ?'LocalPort'\S+)\s+(?'ForeignIP'[^:]+): ( ?'ForeignPort'\S+)\s+(?'State'\S+)\s+(?'PID'\S+)$" "TCP 10.37.47.44:40091 hcc-l-sqld-001:1952 ESTABLISHED 8808"
0 = TCP 10.37.47.44:40091 hcc-l-sqld-001:1952 ESTABLISHED 8808
Proto = TCP
LocalIP = 10.37.47.44
LocalPort = 40091
ForeignIP = hcc-l-sqld-001
ForeignPort = 1952
State = ESTABLISHED
PID = 8808
Only tested a little bit with a very simple utility.
Edit: Some spacing added to avoid smilies.
modified 3-Feb-12 17:39pm.
|
|
|
|
|
No there is no guarantee that you will get results line by line; all you can hope for is to get all the output almost in real-time. In reality I think you normally get one or more entire lines at a time. You could easily capture it all into one string, then apply string.Split() on '\n' (and ignore '\r' that you are likely to get as well).
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|
|
CCodeNewbie wrote: I was trying to use a streamreader writing to a stringbuiler.appendline but I kept getting the whole list instead of individual entries
Building a string out of multiple lines will of course give you just a string.
Instead you use StreamReader to do one of the following
1. Process each line as it is read.
2. Put each line into a collection like a list.
|
|
|
|
|
Thanks for all you comments/ideas but I am still struggling although making progress.
@PIEBALDconsult, I really like the regex idea but can't figure out how to pipe the ouput into you code.
@Luc, jschell - prior to investigating iphlpapi I was trying the Process method and have now gone back to that thanks to your suggestions. Th issues I am having though
- I still can't get the individual items to writeline or to a list
- I can't work out why connections[1]-[6] aren't populated.
- I need to connections[1].split(':') to split the host and the local port
- I need to connections[3].split(':') to split the host and the local port
- I can't get rid of the newlines between the split entries.
My code follows:
Process Ns = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo("netstat");
startInfo.Arguments = "-ao";
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.CreateNoWindow = true;
Ns.StartInfo = startInfo;
Ns.Start();
for (int i = 0; i < 4; i++)
Ns.StandardOutput.ReadLine();
while (true)
{
string Line = (Ns.StandardOutput.ReadLine());
string[] split = Line.Split(' ');
foreach (string s in split)
{
List<string> connections = new List<string>();
connections.Add(s);
if (s != "" || s != Environment.NewLine)
{
Console.WriteLine("Protocol:", connections[0]);
Console.WriteLine("LocalIP:", connections[1]);
Console.WriteLine("LocalPort:", connections[2]);
Console.WriteLine("RemoteIP:", connections[3]);
Console.WriteLine("RemotePort:", connections[4]);
Console.WriteLine("State:", connections[5]);
Console.WriteLine("PID:", connections[6]);
}
}
}
|
|
|
|
|
All you'll get from me are a few pointers:
0. programs tend to do what you ask them to do, which might be different from what you think you asked for.
1. Part of your code is working fine, another part is not. You should inspect intermediate values to determine which parts are which. That is called debugging.
2. When a .NET class or method isn't doing what you expected from it, then it is time to read the documentation.
3. There are several ways to fix what is wrong, some will suggest using Regex. I'm not one of them.
4. I'm baffled by your use of List<string> connections ; it seems like a fancy way of turning an array into a list, then using it as if it were an array. I'm not saying anything is wrong here, however it is peculiar.
5. BTW: if (s != "" || s != Environment.NewLine) is utterly wrong for many reasons, one of them being ReadLine() normally doesn't return something that contains a NewLine string.
Luc Pattyn [My Articles] Nil Volentibus Arduum
Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.
|
|
|
|