|
I've tried to serch in the web and in the site but i've founded nothing.
I need a function that return int random number:
int myn = RandomFunction(100);
it could generate number between 0 and 99.
Does it exist?
|
|
|
|
|
Gee, you must've searched really hard
Random[^]
|
|
|
|
|
look at the Random class in the .net framewok.
/\ |_ E X E GG
|
|
|
|
|
eggie5 wrote:
look at the Random class in the .net framewok.
Gotta look great in email notification! (or is it only my lame english? I read it like he should randomly pick one of .NET classes...)
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
I don't get this message either (alluding to the other message of yours in the lounge I misinterpreted).
/\ |_ E X E GG
|
|
|
|
|
eggie5 wrote:
I don't get this message either
That's my usual problem.
When he gets message notification in email, it's without <code> formating, I belive. So when you don't pay attention to case, you end up reading "look at the random class in the .net framewok.". Ohh hey! I think I get it! "look at the random class in the .net framewok." vs. "look at brandom class in the .net framewok." makes the difference, right? Ok so I would think that you are saying to pick *random* .NET class.
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
DEar Friends
I am developing web page in asp.net with C# i am using the Calender by acme tag
when i m opening the page it gives error as below
Parser Error Message: File or assembly name Acme, or one of its dependencies, was not found.
Source Error:
Line 1: <%@ Register TagPrefix="Acme" Namespace="Acme" Assembly="Acme" %>
Line 2:
Line 3: <html>
Source File: c:\inetpub\wwwroot\intro7.aspx Line: 1
Thanks
Murtuza Patel
|
|
|
|
|
Remember to add a reference to the acme assembly, simply a using statement is not enough.
|
|
|
|
|
Hi,
I'm trying to activate a process on a remote machine and doing so successfuly. The only problem is that I' havn't figured out how to know when the process has ended.
here is an example of the code:
private void run_notepad(string machina)
> {
> ManagementOperationObserver observer = new
> ManagementOperationObserver();
> completionHandler.MyHandler completionHandlerObj = new
> completionHandler.MyHandler();
> observer.ObjectReady += new
> ObjectReadyEventHandler(completionHandlerObj.Done);
>
> string stringMachineName;
> string stringCommandLine;
> stringCommandLine="c:\\winnt\\notepad.exe";
> //Connect to the remote computer
> ConnectionOptions co = new ConnectionOptions();
> stringMachineName = machina;
> //get user and password
> if (machina!="")
> {
> co.Username = "aaa";
> co.Password = "******";
> }
> //Point to machine
> System.Management.ManagementScope ms = new
> System.Management.ManagementScope("\\\\" + stringMachineName +
> "\\root\\cimv2", co);
> //get process path
> ManagementPath path = new ManagementPath( "Win32_Process");
> //Get the object on which the method will be invoked
> ManagementClass processClass = new ManagementClass(ms,path,null);
> //Create an array containing all arguments for the method
> object[] methodArgs = {stringCommandLine, null, null, 0};
> //Execute the method
> processClass.InvokeMethod (observer, "Create", methodArgs);
>
anybody knows how to tell when the process exited?
Thanks,
Haim.
|
|
|
|
|
Hi
How can I select a treenode (in coding) on a treeview and keep it selected (High Lighted)?
I tried the following and it doesn't seem to work as required:
foreach ( TreeNode tn in treeView1.Nodes )
{
if ( tn.Text == "Color" )
{
treeView1.SelectedNode = tn
break;
}
}
|
|
|
|
|
Why isn't it "working as expected"?
That's how you select a node, no need to perform different or additional voodoo.
Could it be that your TreeView hasn't got focus and HideSelection is set to true?
Or that there _is_ no node with Text "Color"?
mav
|
|
|
|
|
Ok must be that the treeview hasn't got focus...
Thanks
|
|
|
|
|
Hi all,
I have a ToolBar on my form. Each button associated to an image from an ImageList .
Why when I disable the button, the button becomes all gray ( and not grayscale image ) ?
Do I have to apply a second grayscale image for each button for disable mode ?
If so, How do I do it ?
|
|
|
|
|
here is my problem.
i have a RichTexBox with a document in it. after some modifications it needs to be printed. however in the printed version no white spaces must be left from the end of a paragraph to the end of the line.
i have tried to adjust the size of the RichTextBox to the size of the paper used by the printer (usualy A4) and set left and right indentation of text (making a copy of the rtf before this in order to print it unindented, otherwise it will just double the indentation) accordingly to printer settings indentation values.
however print preview and printed version text differs from the one shown on screen. the text is printed as formated text with justified align and different fonts and sizes, using a control derived from RichTextBox witch has such printing support described here
now if anyone has any ideas as to how i can atleast hadle this problem ..
|
|
|
|
|
the toggle field view button is disabled so i can see my fieds any ideas on getting it enabled
|
|
|
|
|
found it myself dam document outline window
|
|
|
|
|
hi,
We are doing a project on Live video conferencing in LAN.File is recoreded on a single PC but the actual thing must do is to send the data on a network.I m using directshow for this in which "IMediaControl Interface" is used for run and stop the file to record.But i need the actual data(streams).The question is:
1.How to get Audio & Video Stream data using Directshow?
2.How to send,replay this data on network?
plz reply me soon.
best regards
shumyla
|
|
|
|
|
hi,
i found something rather odd and was simply wondering if anyone can explain this. I have a thread responsible for displaying a Form (in an event driven manner). When trying to display this form, i've notived that usage of .Show() causes the new form to hang (the frame is displayed, but the text field in it is empty, and the mouse shows an hourglass when hovered over this form). On the other hand, use of .ShowDialog() seems to display it fine. Given that it's displayed in its own thread, it doesn't matter which method i use, as the application continues fine. But i was just wondering if anyone can explain why the behaviour is different in this context?
In case it's of any relevance, here's the code
(running on XP Pro, developed in VS .Net 2003 against SDK 1.1)
<code>
public PopupFactory()
{
Thread t = new Thread(new ThreadStart(waitForEvents));
t.start();
}
private void waitForEvents()
{
while ( true )
{
lock(al)
{
Monitor.Wait(al);
l.log("got a pulse from another thread on al");
string[] z_details = (string[])al[al.Count - 1];
ZTransparentWindow z = new ZTransparentWindow(z_details[0], z_details[1]);
z.ShowDialog();
z.Show();
}
}
}
</code>
thanks!
|
|
|
|
|
The reason Show doesn't work is because your thread doesn't have a message pump. Without a message pump, your window can't respond to user actions. ShowDialog runs its own message pump on the calling thread, so it works. See this[^] article to know more about message pumps and stuff.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I too have come across this seemingly odd error, however the solution is pretty clear once you figure out what's happening. An example solution would be as follows:
private delegate void ShowFormDelegate(string[] details);
...
public PopupFactory()
{
Thread t = new Thread(new ThreadStart(waitForEvents));
t.start();
}
private void waitForEvents()
{
while ( true )
{
lock(al)
{
Monitor.Wait(al);
l.log("got a pulse from another thread on al");
string[] z_details = (string[])al[al.Count - 1];
this.ShowForm(z_details);
}
}
}
public void ShowForm(string[] z_details) {
if(this.InvokeRequired)
{
this.BeginInvoke(new ShowFormDelegate(ShowForm), new object[] z_details});
}
else
{
ZTransparentWindow z = new ZTransparentWindow(z_details[0], z_details[1]);
z.Show();
}
}
Although I haven't tested the code, and therefore cannot guarantee that it works, you should be able to get the idea behind it. I myself am still not QUITE certain why the Show() method doesn't work the way you had it, but I assume it has something to do with the thread that it's being called from. This method guarantees that the form is spawned from the main window. Good luck.
|
|
|
|
|
In richtextbox has Undo(), but it clear all text
I want it excute such as notepad program
hello
|
|
|
|
|
The Undo function in a RichTextBox behaves like the one in a TextBox (what Notepad is, basically).
If you want anything else you'll have to specify it more clearly.
mav
|
|
|
|
|
Dear everybody
I am programming with DataGrid control in C#. The problem is that when my column header text is too long. How can I make this text wrapped into another line? The same problem with the column header but in the case I want the text showed vertically.
Thank you very much
Nguyen Thai Binh
|
|
|
|
|
try it by increasing header font size.
|
|
|
|
|
Font's size doesn't affect anything. When the text is too long, it is just hidden by other columns. And if you want to show the text vertically, you have no way???
|
|
|
|