|
|
bascially,
we are looking for a method
to find out when a new mail arrives,
when it arrives and is from a certain sender,
we then want to detach the file attachment
and use the detachment in our application
|
|
|
|
|
Hello,
I am creating an application. But now i have added a login form, which i want now to be the new startup form.
I am not sure how to change the startup form. I have tried going through all the properties, but can't seem to change it to the new login form.
Many thanks in advance
Steve
|
|
|
|
|
Could it be that you're more of a VB-person?
Ok, seriously, in C# a Windows Forms application is usually run by instantiating a form (can be anything, no special properties required) and feeding this form into Application.Run() .
This is done in a static class member called Main , also in an arbitrary class.
If you have several classes with a static Main method then you'll have to tell VS.NET which one to use.
So you just have to find the Main() method in your project, where you'll find somethng like:
Application.Run(new Form1()); and change it to
Application.Run(new NewLoginForm()); (or whatever the name of your login form class is).
Mav
|
|
|
|
|
As you said, we can write down the following code:
namespace somenamespace
{
public class form1()
{
...
static void Main()
{
Application.Run(new form2());
}
}
}
So, can I take the Main() method as an independent entrance in the form?
hello, world
|
|
|
|
|
This one is simple enough, for something like this, you DON'T change the start up form. Your main form should call the login form to get it's authentication information before showing itself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for you help,
I am new to C#, but l think VB is much more simple at doing this.
Steve
|
|
|
|
|
No, not really. THe two languages are closely related and they both use the same classes and compile to the same IL. It only seems more easy because you're more familiar with VB...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
|
sorry.
In fact, I mean how to implement a registration key or serial no for a shareware.
Regardless, thank you!
|
|
|
|
|
|
Hello,
Does anyone have an example of using the RASDial or RASApi32.DLL with C#? I am looking to be able to create a VPN connection programatically from within an automation application. I need to be able to establish a VPN connection nightly and download a file from a server. I have found a VB6 example of using RASApi32.DLL and launching the DUN for the VPN configuration, but would rather work with C#.
Thanks
|
|
|
|
|
Look into this site for example:
http://pinvoke.net/[^]
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
How to check whether there are number or character at string only.
|
|
|
|
|
string str = "abcd1234";
for(int i = 0 ; i < str.Length ; i++)
if(str[i] < 58 && str[i]> 48)
{
....
}
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
I am trying to use this WMI class (correct term) to extract a list of users and the groups they are members of. Not completely sure how to do this, the ManagementObject returns two fields called Name, one the user name and one the group name, and when I try to print out both my app throws an exception.
|
|
|
|
|
|
I am trying to load a window form from a console App. I inlcude System.Windows and System.Windows.Forms in my project but when I try to load the form by doing
Form abc = new Form(params)
abc.Show()
it doesn't load i.e. it doesn't pop up.
Interestingly if I add a MessageBox.Show statement the form loads.
Would like to know what's going on here.
|
|
|
|
|
Gumnaam wrote:
Form abc = new Form(params)
abc.Show()
The following works for me:
using System;
using System.Windows.Forms;
public class test
{
public test(){}
public class nick : System.Windows.Forms.Form
{
public nick(){}
}
public static void Main(string[] args)
{
test t= new test();
nick n = new nick();
n.ShowDialog();
}
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
try something like this instead
SomeForm form = new SomeForm();
form.ShowDialog();
the code above returns a DialogResult but you dont need to necessarily get that value unless you want something back from the user
regardless of this - why would you be adding gui elements to a console application to begin with - you might want to create a Windows Forms Application instead..
Danny!
|
|
|
|
|
I am writing a DLL in VC++ that needs to be called by one of our customers who use C#.
Unlike my VC++ test application, which statically links the DLL to the EXE and creates the object upon startup, the C# application appears to load the DLL at runtime at the first reference to a DLL call (using the import keyword).
THe problem is that subsequent calls to other functions do not work. It seems that there needs to be some pause for the load to happen.
Has anyone encountered a similar problem?
Ed Hopkins
|
|
|
|
|
Ed Hopkins wrote:
THe problem is that subsequent calls to other functions do not work. It seems that there needs to be some pause for the load to happen.
Does the first function call always work? Have you tried calling different functions the first time to see if there is a problem? If your dll that you are writing in C++ is based on COM I would hightly recommend you read through information on Runtime Callable Wrappers[^] on MSDN.
- Nick Parker My Blog | My Articles
|
|
|
|
|
It's not quite that simple ... it works A-OK from the VC++ demo app. It's NOT written in COM just a standard Win32 MFC DLL written in VC++.
The timing appears to be due to the finite # of milliseconds it takes for the DLL objects to get created. They are not ready yet, and a subsequent call returns an error since it is pointing to things that are not yet created. Quite strange.
Ed
|
|
|
|
|
Hmm, seems to me I've heard MFC doesn't
play nice with other frameworks. And
.NET is a framework. I've run into some
strangeness with MFC. I remember I was
experimenting with forms in DLLs and had
one done in Delphi that I launched from
a VC++ 6.0 MFC app using a worker thread.
No matter what I did when I closed the
DLL form, I got an exception. However
if I displayed a messagebox in the VC++
app after closing the form, I never got
an error. I chalked it up to Delphi
having a VCL and MFC not being at the
root of all the GUI stuff, but who knows?
Of course the Delphi DLL form worked fine
with every other app I used to launch it,
such as Delphi and VB 6.0. Go figure.
|
|
|
|