|
Does this have something to do with a C# problem?
Use the best guess
|
|
|
|
|
Not a C# question. Next time, you can post in the database section for better answers.
However, IMO, you should stick to one stored procedure unless you follow coding standards where you have to have a view per report.
|
|
|
|
|
I need the encryt and decrypt cod using one time pad
for client and server
gruda
|
|
|
|
|
Member 10038068 wrote: I need the encryt and decrypt cod using one time pad Look in the Wikipedia[^] what a one-time pad is and make an attempt at writing it. If you have a specific question, I'll gladly help
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
yes I red that but in C# i cant the cod
can you finish the cod and send me for client and server
|
|
|
|
|
Member 10038068 wrote: can you finish the cod and send me for client and server Can you paint my garage?
I'm gonna skip this question.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
We do coding in different Style .
Which is most effective style of coding in C# to build a Class Library , which can be used in both Desktop and Web applications.
Suggest with example.
Regards
Bikash
|
|
|
|
|
This[^] MSDN page is what comes to mind after reading your question. I assume you're familiar with it?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
This always returns true, whether I have notepad open or not, can anyone tell me what I'm doing wrong?
if (IsSingleInstance())
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(Args));
}
else
{
Process current = Process.GetCurrentProcess();
foreach (Process process in Process.GetProcessesByName(current.ProcessName))
{
if (process.Id != current.Id)
{
SetForegroundWindow(process.MainWindowHandle);
break;
}
}
}
static Mutex _m;
[STAThread]
static void Main(string[] Args)
{
static bool IsSingleInstance()
{
try
{
Mutex.OpenExisting(@"Global\Notepad");
}
catch
{
Program._m = new Mutex(true, "Notepad");
return true;
}
return false;
}
}
|
|
|
|
|
What TYPE of exception is thrown? You may be having permission issues or something else... that is, the notepad exists and it's running, but you don't have permission to access it. If you look in the docs, there's 5 different exceptions it can throw, and the situations are very different...
http://msdn.microsoft.com/en-us/library/c41ybyt3.aspx[^]
|
|
|
|
|
Hi,
Thanks for the reply. It cannot find the handle, which is why I'm trying to find an example that works and then build from that.
Quote: No handle of the given name exists.
|
|
|
|
|
You don't call OpenExisting on the Mutex object. You simple try to create a new instance of the Mutex with the same name. If the object is created, it's the only one in the system. If the create fails, then you know you're not the first instance to run.
You don't create the Mutex in the Catch block. By the time you get there, you never created a mutex in the first place.
|
|
|
|
|
Thanks for the reply ... I know I'm the one asking for help here, but I saw this technique all over the internet, including msdn, only with the MSDN example it is done by calling a function in the catch.
Am I overlooking something possibly or misunderstanding?
http://msdn.microsoft.com/en-us/library/c41ybyt3.aspx[^]
|
|
|
|
|
turbosupramk3 wrote: Am I overlooking something possibly?
There is quite a bit more in that example code, than what you have implemented in yours. The issue I was thinking about is the different exception types... you are using Pokemon exception handling (catch 'em all) - but the example catches each exception type and handles it differently.
However, your exception (no handle exists with that name) is telling us the problem, and it's what Dave said it was - it doesn't exist, and you aren't trying to create it, you're trying to "get" it.
|
|
|
|
|
Just because you see a technique all over the Internet does not mean that it applies to your situation.
From what I've seen in your code, it suggests you're trrying to make a single instance app. The code you have is not suited for that purpose at all. To make a single instance app, an application first tries to create a Mutex. If it's successfull, it's the first app instance running. If the creation of the Mutex fails, then you know your app is not the only instance running.
Follow the logic in your code snippet and you will see that it does not follow the logic I just laid out.
|
|
|
|
|
I believe I understand now and yes I was trying to make a single instance app.
I had thought a mutex was created as a default and I was trying to find that. Now I have the code set up to create a mutex and if it cannot create it, to bring the minimized app to the foreground.
Thanks for the help.
|
|
|
|
|
|
i have created a login page by c# in visual studio.
if i want to take it as my system login page,what are the next steps to be done?
With out this login authentication no one could access the system.
|
|
|
|
|
Set your Login Page as the startup form and display that Modal dialog. When the authentication succeeds, continue with the application.
|
|
|
|
|
i want my login page right after booting.. with out this login no one couls access any features of windows.
|
|
|
|
|
You're not going to do that in a C# application.
Your application cannot stop people from using Windows. They have to enter their own credentials to get into Windows to evern see your app, correct? Your app is pointless since you cannot stop a user from terminating your app quite easily.
Now, if you wanted to provide a custom authentication package for Windows to use, you would have to write a Credential Provider[^] and register that with the system. The users can then enter their alternate credentials for your authentication scheme. Oh, you'll be writing this in C/C++, not C#.
|
|
|
|
|
i want to use my login page insted of windows login page .
can i?
|
|
|
|
|
No, you can't. Not unless you rewrite Windows...
|
|
|
|
|
|
I have a asp.net website which I want to run locally without using IIS, through a windows application,
I want to whether this is possible and know how this is done, please let me know if u have any information in this regard.
|
|
|
|