|
BINOVAR wrote: 1.What is the equivalent settings for option strict on and option explicit on in c# ?
There isn't one. These constraints are always enforced and cannot be disabled.
BINOVAR wrote: 2.I have a class in another project ( VC++). I want to access the methods and properties in VC++ class from my project in C#. The VC++ is a standalone EXE project and hence I cant add any
reference to my project. But in VB I found a method named GetObject( "AssemblyName") to retrieve the object in runtime. As VB.Net supports early binding by setting option explicit ON , the
methods and properties of the VC++ class can be accessed by creating an instance of system.object. Can anyone please tell me how can we do the same in C#.net ?
Look into p/invoke; I know you can access native dll's that way, I've never tried abusing an exe like that. Worst case would be writing a VB.net wrapper dll and calling that from C#.
BINOVAR wrote: 3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.
No. And you shouldn't be using it in VB either unless you like corrupting your state and data.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
BINOVAR wrote: 3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.
Someone will slap me for saying this, but you can also nest try catch blocks, and there's no requirement to have code inside the catch portion of the try block. At some point you will be causing the hari kari of whatever dev has to look at the code later though.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
Skymir wrote: Someone will slap me for saying this
You know already it is a bad thing. You obviously don't need someone to tell you. I've just had my dinner and not feeling energetic enough to slap anyone so, if you don't mind, could you do it yourself.
|
|
|
|
|
No worries, I forgot what I'm picking up at the store on the way home tonight. The wife will take care of the slapping.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
BINOVAR wrote: We can use Try catch but catch block will be excuted if any error occur in try block.
If I find out you have written a try-catch-ignore block I will reprogram your software with a large and very blunt axe.
|
|
|
|
|
Hello guys , i want to split a string but also save the delimiters in the resulting string array . How can i do that (if i can) ?
thank you !
|
|
|
|
|
How far you have done until now?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
string[] small = matrix.Split(new char[] { ' ', '<', '>' });
it just saves the strings between the delimiters ,but i want them too ( if i had only one delimitor , that wouldn't have been a problem, but i have 3 of them and i want them in the exact order )
|
|
|
|
|
I'd suggest writing your own split function. Easy enough to do, use a StringBuilder and add each character one by one. If its one of your delimiters, add the string so far to the list and start again with an empty one.
Regards,
Rob Philpott.
|
|
|
|
|
after 2 hours sleep :
Regex RE = new Regex((@"([\ \<\<])"));
string[] small= (RE.Split( matrix ));
works
|
|
|
|
|
Yikes! That's scary. How's the performance though?
Regards,
Rob Philpott.
|
|
|
|
|
Here you go..
string str = "123 <456> <345> 456><7<";
Regex RE = new Regex(@"(^|\ |\<|\> )\w+($|\ |\<|\> )");
MatchCollection MC = RE.Matches(str);
if (MC.Count == 0) MessageBox.Show("No match");
foreach (Match M in MC)
{
MessageBox.Show(M.ToString());
}
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|
|
Hi ,
I need help...
I have a Datatable with wich i populate data to Gridview..... I also have a Button named "Email" at the bottom of the page . When the user clicks the Email button. an email has to be sent to manager@abc.com containing the contents of datatable in table format.
I am able to show the data in gridview, but i want the code to send the EMAIL with contents of datatable in table format.
I am using ASP.Net 2.0 with C#
will be waiting for reply.. plz help me out...
Thanks
|
|
|
|
|
Why don't you export it to excel or csv?
|
|
|
|
|
At any given time the Datatable would only contain 9 records with 7 columns,It is a small table hence my manager wants me to show it in the body of email instead of moving the data to excel doc and then attaching it to the email.
|
|
|
|
|
Hi Guys,
Occasionally seen in License Agreements, The text containing in the Text Box is so long that the user has to scroll up and down to view the entire text (most users dont prefer to ). However, when I try to enter a long paragraph in the text box by braodening the length and breadth of the text box, I am only able to get a partial view of the paragraph, i.e., only half of the paragraph is visible and the other remains below which is not viewable. How can I implement the scrollbar in the text box which has long paragraphs to be insersed in, such that I am able to see the texts, no matter how long they are, using the scroll bar to scroll up and down?
I believe the this question is about desiging. It some code also must be implemented here, please tell me....
Your help will be appreciated....
Thanx, Rajdeep.NET!
|
|
|
|
|
|
Thanx Tom
|
|
|
|
|
Set the TextBox's Multiline property to true and ScrollBars to Vertical. It might be a good idea to set ReadOnly to true as well.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Thanx Davey!
|
|
|
|
|
Hi all,
i'm trying to create a OU in AD to have a otherWellKnownObjects attribute.
i can access the OU fine while connecting to it normally. but as soon as i try to access it via the otherWellKnownObjects attribute i get the error - "There is no such object on the server" and when i check the attribute in AD is it no longer set to null but i am unable to view its value!
any ideas?
Many thanks,
Phil.
|
|
|
|
|
I have spent some hours trying to read a checkbox enabled status on form1 from a different thread without any joy. Lots of research about Invoke etc has shown me how to write to the form but no clue as to how to read from the form. Can anyone here point me in the right direction please?
Cheers, Bruce
|
|
|
|
|
I didn't try it, but Invoke should do the trick to read a check box state.
|
|
|
|
|
Why use Invoke? Just read the control like usual..
private void btnReadControlThread_Click(object sender, EventArgs e)
{
Thread thread = new Thread(ThreadReadControl);
thread.Start();
}
private void ThreadReadControl()
{
MessageBox.Show("Enable status is " + cbEnableStatus.Checked.ToString());
}
8.Kelvin()
{
while (!(the machine can program itself))
Wont_stop_coding = true;
}
|
|
|
|
|
Many thanks. Typical! me trying to overcomplicate things again. Cheers Bruce
|
|
|
|