|
Please come to my question............. ]if i put try catch inside the dll , that will catch the exception
My small attempt...
|
|
|
|
|
|
For what?????
Hi all please understand my question..............
1. I am calling a method from an application ( example APP) ,which is inside a dll( example DLL)
2. Just assume that that method is crashing( in side DLL)
3. I want to catch the exception in the calling application( APP)( the application from which i called the dll method)
---------------------------------------------------------------------
My small attempt...
|
|
|
|
|
|
"if you cannot catch the exception from method Execute, that means there is something wrong in the method." please try to understand that i dont want to find the root cause or reason for the exception... i want to catch the exception in the c# application which calls the DLL.............
Please imagine that i put some code which generates exception.I dont want to debug and find the reason i just want to catch it on my application...
My small attempt...
|
|
|
|
|
Hello All,
I am Savitri Here. I am new to this forum and also to this language. I am doing one application in C#. Now i have two forms called Mainform and LoginForm. After running we login form will come and after successful login will get mainform. I want to assign the entered user name to toolstripstautuslable of statusstrip which is in mainform.When i clicking login button then only i am setting new value for that status strip but it is not assigning. Please help me. Below is the part of code.
LoginForm.Cs
<br />
MainForm frm = new MainForm();<br />
private void btnLogin_Click(object sender, EventArgs e)<br />
{<br />
string username,password;<br />
username=txtUsr.Text.ToString();<br />
password=txtPwd.Text.ToString();<br />
if(username.Equals("xxxxxx") && password.Equals("xxxxxx"))<br />
{<br />
MessageBox.Show("SuccessFully Logged in");<br />
frm.toolStripStatusLabel2.Text = txtUsr.Text;<br />
frm.GetValues(username, password);
this.Visible=false;<br />
}<br />
else<br />
{<br />
MessageBox.Show("Not valid UserName and Password");<br />
}<br />
<br />
}<br />
MainForm.cs
public void GetValues(string strUsr,string strPwd)<br />
{<br />
this.UsrNam=strUsr;<br />
MessageBox.Show(UsrNam);<br />
this.PasPwd=strPwd;<br />
MessageBox.Show(PasPwd);<br />
this.toolStripStatusLabel2.Text = UsrNam.ToString();<br />
this.Refresh();<br />
}
Please Give me hints. Help me.
Thanks in Advance.
Regards,
Savitri P
|
|
|
|
|
Does this line MessageBox.Show(UsrNam); show the username?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry,
Ya that is user name. I want to display that user name into status strip in main from. Please give me some hints to solve this problem.
Thanks in Advance.
Regards,
Savitri P
|
|
|
|
|
Yes, I understand that, but when the MessageBox displays, does it show the username, is it blank, does it display something that you are not expecting?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Ya it is displaying username in messagebox but it is not showing in status strip and not refreshing control also. I tried many ways but it is not displaying.
Regards,
Savitri P
|
|
|
|
|
The code you have provided, is over complicated:
your code:
public void GetValues(string strUsr,string strPwd)
{
this.UsrNam=strUsr;
MessageBox.Show(UsrNam);
this.PasPwd=strPwd;
MessageBox.Show(PasPwd);
this.toolStripStatusLabel2.Text = UsrNam.ToString();
this.Refresh();
}
can be simplified to:
public void GetValues(string strUsr,string strPwd)
{
this.UsrNam=strUsr;
MessageBox.Show(UsrNam);
this.PasPwd=strPwd;
MessageBox.Show(PasPwd);
this.toolStripStatusLabel2.Text = UsrNam;
}
other than that I can see no obvious reason that it should not work.
As a test that toolStripStatusLabel2 is working, temporarily replace this.toolStripStatusLabel2.Text = UsrNam; with this.toolStripStatusLabel2.Text = "Is this visible"; .
If you can see "Is this visible" when you run the application, then I am at a loss. If however, you cannot see it, then there is something wrong with one of the properties of toolStripStatusLabel2 possibly the Visible property is set to false, possibly the location or size properties are incorrectly set. It might even be hidden behind another control.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry,
Thanks a lot.I got the result correctly. Thanku very much.
Regards,
Savitri P
|
|
|
|
|
My pleasure.
Good Luck.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I've searched the forums, but I lack the proper keyword, and need a nudge in the right direction.
Amateur programmer:
Somebody told me that the login/logout times of past 3 weeks are stored somewhere on the pc:
I;m not bothered, whether this is System specific, or user specific, but I need to know where they can be queried;
Options:
- Registry
- Edirectory
- ActiveDirectory
Anyone experience?
|
|
|
|
|
vincentnl78 wrote: Somebody told me that the login/logout times of past 3 weeks are stored somewhere on the pc:
No, they're not.
The only place that would have anything like this would be the Security event log, which IIRC, by default, doesn't log user logon/logoff events.
ActiveDirectory does not keep track of the last 3 weeks either.
|
|
|
|
|
Well, the answer is still usefull;
I;m trying to dectect when the PC was turned on; by sifting and screening through all the logs, i can detect activity;
Security log might be best bet;
tx
|
|
|
|
|
Not really. The system being turned on will only show in the security log as a SYSTEM account login event, IF the machine is configured to log these events. Shutdown may or may not show up, but usually doesn't. Again, it depends on what is being logged.
There really isn't any 100% foolproof way to get what you want unless you specifically setup group policy in an ActiveDirectory environment to log all this stuff.
|
|
|
|
|
hi!
Since VOIP is prohibited within some area, broadband internet ISPs block VOIP ports or drop VOIP signal and voice packets,so i want to wrapp the VoIP trffic into a package which can not be detected by ISP.
So can any one please help what should i do for wrapping?
Which technology should I use?(may be SSL Tunneling or any other?)
Please help me.
thanx in advance
Note:May be this is not the right forum,but i dont know which technology or programing lang i should use)
|
|
|
|
|
|
Well, you have a problem. You need your wrapper installed on both clients. You can't just wrap it on your end and expect the receiver to know what to do with the packet. Also, you can't write this in C# since it's going to be a driver you install into the network stack. You have to use C++ to do this.
|
|
|
|
|
Hi pals,
I am trying to create a small utility which can block folders from direct access. For this purpose, I have a textbox in my form and a two buttons namely: browse and apply.
Now, whenever the user clicks on browse, the Open file dialog box appears and whatever folder has been selected by the user is displayed in the textbox.
Now, comes the major problem. In order to block the particular folder selected by the user, I have to generate two batch files (files with .bat extension) on the location of the folder, that has to be locked. Like if the folder to be blocked is in this 'C:\\myfolder\\subfolder\\lockfolder' location, where lockfolder is the particular folder which I have to lock, then in that case, I have to generate a batch file in 'C:\\my folder\\subfolder\' that will lock the folder 'lockfolder'.
Any Idea how to do that..... please recommend.
Sorry for my poor english,
Cheers to you,
Rajdeep.NET
|
|
|
|
|
For goodness sake man!
Google for writing text files c#.
You have learned to google by now surely?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Henry Minute wrote: For goodness sake man!
Google for writing text files c#.
You have learned to google something by now surely?
Fixed that for you.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
OriginalGriff wrote: You have learned to google something by now surely?
Nope.
Answered that for you.
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
GOOGLE.....!!!
LEARN C# FIRST...!!!
|
|
|
|