|
Thanks for that bit of code that does work for the main app assembly, but how do i get it work for resource only assemblies, which are updated outside the project. I cant access the class because it is internal below is a web pag that tells me the following:
Listing 1: A static class is generated for all strongly-typed resources.
This class and its properties must be made public in shared, resource-only assemblies, in order for them to be accessible to other components as shown in Figure 2.
http://www.theserverside.net/articles/showarticle.tss?id=LocalizationPractices
this does not make sense because if you up date your resources the class and its properties change back to internal with the auto generated code tool.
Hope you can help in some way
|
|
|
|
|
How do I read output from another shell program (e.g. netstat --or-- dd) so I can input it into my program?
The current code I have is:
/********************
* Get the list of devices from dd.exe
********************/
System.Diagnostics.Process process1;
process1 = new System.Diagnostics.Process();
process1.EnableRaisingEvents = false;
string strCmdLine;
strCmdLine = "/C dd.exe --list > list.txt";
System.Diagnostics.Process.Start("CMD.exe",strCmdLine);
process1.Close();
My goal is to read a list of devices that it's capable of and provide a list. This program is jsut going to be a wrapper to the shell program.
Any suggestions?
|
|
|
|
|
Look at the ProcessStartInfo class. It has a RedirectStandardOutput property, which lets you read from the StandardOutput streamreader of the process. Then you don't have to bother with cleaning up temporary files when you are done.
|
|
|
|
|
That was exactly what I was looking for, thanks!
|
|
|
|
|
Is there a way to display writeln, write, or any output from the program
in the debuger output window.
Because, I had to create an additional testForm with the richTextBox in it so I can see my print statements.
Thank you
|
|
|
|
|
|
I'm looking for a way to make an authentication form to my windows form based app. I want this form to be left in front of the parent main form, until user succeccfuly authenticate. If he press cancel it close the parent form. No other from may be load in front if this authentication form.
TIA,
Ronen
Ronen
|
|
|
|
|
You may use the ShowDialog() method to wait for a response and cast its return with DialogResult class.
Or in the Deactivate event of this login form write:
Activate().
|
|
|
|
|
I'm looking for a way to make an authentication form to my windows form based app. I want this form to be left in front of the parent main form, until user succeccfuly authenticate. If he press cancel it close the parent form. No other from may be load in front if this authentication form.
TIA,
Ronen
Ronen
|
|
|
|
|
Make it modal.
When you load you're authentification form, call
theAuthForm.ShowDialog(parentForm); and that's probably enought but if you are looking to have the dialog abolutely on the top of all the others application windows , try the property theAuthForm.TopMost=true.
I hope I've correctly understood your question.
Julien
|
|
|
|
|
I have Form1 (main form) containing menues, and etc...
Then by clicking on the menu options in Form1, I invoke the children of Form1 :
private void menuNew_Click(object sender, System.EventArgs e)
{
string a = "New_Click";
Form2 fNew = new Form2(a);
fNew.MdiParent = this;
this.menuNew.Enabled = false;
fNew.Show();
}
something like that.
When I am ready to close fNew form, how do I set menuNew back to enabled.
I know you can do it prety easily using ShowDialog, but I have to do it with MdiParent settings.
Thank you
|
|
|
|
|
Make a public property of the Form1
public bool NewMenuEnabled
{
set{ this.menuNew.Enabled = value; }
}
And when your MDI form is closed, go something like
((Form1)MdiParent).NewMenuEnabled = true;
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuals for Christ, Yeah!
Judah Himango
|
|
|
|
|
One approach I woulds suggest is that your parent register with the child Closing() or the child Closed() event. Then when the application window is closing, the parent can reset the menu.
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
I want to know if there is a way for me to read decrypted data from a CryptoStream and added it to a HashTable. Right now I write the decrypted data to an xml file and then read the data back in from the xml file and add it to a HashTable. I want to skip the part of writing the data to the xml file and just add it directly to the HashTable. However, the CryptoStream class does not have a ReadLine() or Peek() method. I need to be able to read one line or character at a time. Any help would be appreciated, thanks.
|
|
|
|
|
The CryptoStream is a byte stream, not a text stream. Depending on the encoding of the encrypted data, one byte might not correspond to a character. If the encoding is utf-8, for an example, some characters may use more than one byte.
You need a StreamReader to read directly from the CryptoStream to get the encoding right. Example:
StreamReader reader = new StreamReader(cryptoStream, System.Text.UTF8Encoding);
---
b { font-weight: normal; }
|
|
|
|
|
While creating C# Class Library (DLL) Using Visual Studio .NET, once we have created the dll file, then if we want to use the dll file in someother projoect then I have to add it as a reference by Project->Add reference. I was wondering if I have to do it everytime I create a new client program or just I have do it once and then in each client project/program I can call the namesapce by
using mcMath; \\ Assuming that my dll is called mcMath
|
|
|
|
|
You would stil have to add the reference to each application that you wrote that uses this .DLL.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can I create an installer which installs itself and I don't need to add it as a reference always?
Regards and Thanks a lot,
Amit
|
|
|
|
|
There's no such thing. The only way to get this functionality is if you modify the project templates to include your reference in the default list of references for that project.
There's no such thing as just typeing using ... and having the reference automatically made. The only reason you think you see this is because the namespace that your using is part of an existing reference.
Try it, create a new C# application, but don't add anything to it. Look under References and you'll see that there is a default set already made. Look in the Object Browser and you'll find that every namespace under those references (the .DLL's) is available just by typing using ... at the top of your code. But this exists ONLY because the references have already been made.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
My software (C# Winform) need to connect to a website to download a file.
The file is sought on the website with the login and password, then given to the client to download.
If I try with the browser, the website gimme a page with the password and the login and a "Connect" button.
I would like to emulate that work, without using the browser.
I'v no problem to connect to the Url and to download, but don't know how to send the login and passwor. I've try the code below, but it doesn't work.
<br />
MyLogin = "Me"; <br />
MyPassword = "11111111"; <br />
MyUrl = "http://mySite.com/MyPage.php"; <br />
clsDownLoadFile MyDownload = new clsDownLoadFile(); <br />
clsDownLoadFile.htmlStream MyStream = new clsDownLoadFile.htmlStream(); <br />
MyStream = (MyDownload.FindUrl (MyUrl, MyLogin, MyPassword)); <br />
if (MyStream != null) <br />
{ <br />
if (MyDownload.IsWebConnected()) <br />
{ <br />
string s = "login="+MyLogin+"+passwd="+MyPassword; <br />
WebClient myWebClient = new WebClient(); <br />
Stream postStream = myWebClient.OpenWrite(MyUrl,"POST"); <br />
postStream.Write(postArray,0,postArray.Length); <br />
postStream.Close(); <br />
try <br />
{ <br />
myWebClient.DownloadFile(@"C:\Temp", "MyFile.zip"); <br />
} <br />
} <br />
} <br />
I catch an exception when trying to download. I thought beacuse the Identification on the server doen't accept me.
Could someone help me, I drown...
|
|
|
|
|
no expert opinion on my problem?
|
|
|
|
|
Hello,
I have a progress bar and i have the min set to 1 and the max set to 100. I want to be able to click on part of the progress bar and for the progress bar to go to the value that l click on in the progress bar.
For example if the progress is on 10, and l click on the bar in the area of about 80, then the progress will go up to that value of 80.
Many thanks in advance,
Steve
|
|
|
|
|
Weird usage of a progress bar... but you can handle the mouse down and check where the click occured. Based on the location and the size of the progress bar you can determine the value to set.
Alex Korchemniy
|
|
|
|
|
You'd have to handle the MouseDown event of the Progress control. In there, you would get the mouse coordinates where where the user clicked the mouse button. Call the control's PointToClient method with those mouse coordinates to get the point mapped to a usable point in the control. You then have to do some math to determine how far from the left side of the control the user clicked the mouse, then map that number to a value between 1 and 100 so you can set the appropriate value in the ProgressBar's Value property.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
steve_rm wrote:
I have a progress bar and i have the min set to 1 and the max set to 100. I want to be able to click on part of the progress bar and for the progress bar to go to the value that l click on in the progress bar.
Why not use a TrackBar instead?
Roy.
|
|
|
|