|
we should be able to use either without issues - .cs and .vb
|
|
|
|
|
You can, but not the way you are trying.
only two letters away from being an asset
|
|
|
|
|
Just add a reference in your VB.NET project to the dll containing the C# function. In your VB.NET code, you'll can then call the C# function as if it were written in VB.NET.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Dumbest. Movie. Title. Evaaar.
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
it is not a separate project. I am adding this .cs file into a vb.net project.
this .cs is reading a csv file and returning a datatable.
Thanks.
|
|
|
|
|
Sorry, that won't work. A project must be entirely in one language. If you need to use multiple languages, use multiple projects in a single solution.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Dumbest. Movie. Title. Evaaar.
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
That won't work; you have to create seperate projects. You cannot combine different languages in the same project. You can, however, combine projects of different languages in the same Solution. Your C# code would have to go into it's own Class Library project, then in your VB.NET project, add a reference to the C# project.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello!
I'm trying to do some P/Invoke, but the native DLL is an optional component, i.e. it isn't sure that it is present.
How can I test if P/Invoke will be able to call the DLL?
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Can you test the DLL's existence before calling DllImport()?
Best,
Jun
|
|
|
|
|
Well, I'd need to search in several directories (system directory, application directory, etc.), and even if I find a DLL it's not sure that this DLL is really a valid library (could be a text file for example)...
Isn't there any way to test if a loadable DLL is present?
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
As far as I know, there is no way to test if a DLL is loadable, except for catching exceptions when DllImport fails.
Best,
Jun
|
|
|
|
|
You might want to look into trying to load the .DLL using the Assembly class. You might also want to look into doing this in a seperate AppDomain so you can unload it.
-- modified at 12:07 Friday 25th August, 2006
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
No there is not. You could do interop to DllLoadLibrary to see if you can load the DLL this way. If it fails then the dll is not present.
Deus caritas est
|
|
|
|
|
Hi,
I have a bit of situtation here..
I have to check whether the current time is between two pre-defined time values. But, if the second time value is less than the first, then the second time value must be assumed of next day and then current value should be compared. Details are as below ---
time t1 = 10.00.00 PM
t2 = 11.00.00 AM
Current time should be between these two. But as shown above t1 > t2, in this case i want to assume that t2 will be time of next day. (current day +1). And after these considerations i want to find out whether current time is between these t1 and t2.
Actually i am trying to replicate the night duty schedule. If the current time is between the night timings then some operation must be performed or if it is not between the office timings then the operation will be discarded.
Hope i am clear with the situation !!
Please reply as soon as possible.
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
try this
<br />
DateTime start = DateTime.Parse("10:00:00 PM");<br />
DateTime end = DateTime.Parse("11:00:00 AM");<br />
if(end < start)<br />
{<br />
if(DateTime.Now < start)<br />
start = start.AddDays(-1);<br />
else<br />
end = end.AddDays(1);<br />
}<br />
<br />
if(start < DateTime.Now && DateTime.Now < end)<br />
{...}
-- modified at 14:48 Friday 25th August, 2006
<edit> Just came to mind that internal if else is also required so added that.
Regards
Shajeel
|
|
|
|
|
hi all,
how can i use the smtp server installed on my computer in order to send mails using it?
SmtpClient y = new SmtpClient();
>>> y.Host = "???"; //what should i write here ?
y.Send(textBox1.Text, textBox2.Text, textBox5.Text, textBox6.Text);
am i able to send mails to yahoo, hotmail, gmail or other mail servers using my smtp server ???
help me please ...
thanks in advance,
bye.
MFA
|
|
|
|
|
use SmtpMail.SmtpServer ="ur servers ip address";
rahul
|
|
|
|
|
Message Closed
modified 27-Apr-15 11:24am.
|
|
|
|
|
sorry but u cant.
i think MS prevents spam mails so.
|
|
|
|
|
greekius@hotmail.com wrote: i think MS prevents spam mails so.
MS doesn't do anything to prevent spam from being sent using System.Net.Mail classes. Why would you think they would?
only two letters away from being an asset
|
|
|
|
|
If it is your machine then use the IP address of your machine.
only two letters away from being an asset
|
|
|
|
|
Message Closed
modified 27-Apr-15 11:24am.
|
|
|
|
|
|
That means that the server is configured to prevent spamming. It will only accept mails addressed to a local user and it will not send mail for anyone other than a local user.
You need to create a user on your server and use that user to send your mail or configure your server to allow relaying.
See your SMTP-Server documentation.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Have you ever tried using using RCXpress.BLL.Portal.TMSMailMessage ?
|
|
|
|
|
Hi All,
Can any one tell that how do we get the HostedControl of cell, for example in case of DataGridViewButtonColumn
for example i want to get
of (DataGridViewButtonColumn)dxDataGridView1.CurrentCell.HostedControl
is there anything like HostedControl???
Thanx
sorry for my bad English.
|
|
|
|