|
Good people,
Over the next year or two, I will be building applications to perform specific tasks related to my job. However, I want these specific applications to end up comprising one application. So for example, when I finish the first app, I want to add the second app to it. This will enable me to have a very useful application that performs different but related tasks.
My question is, what strategy should I pursue to do this effectively. You see, while the tasks are different, they all are related to some type of data analysis and processing. That's why it would be great to have it as one application with components being added.
Let me know your thoughts.
Thanks in advance.
BP
|
|
|
|
|
|
I ma developing a C# application now that will have multiple sub-apps. I'm building them as seperate DLL's and loading them dynamically at startup. Maybe this would work for you?
Everything Makes Sense In Someones Mind
|
|
|
|
|
BlitzPackage wrote: Over the next year or two, I will be building applications to perform specific tasks related to my job
I guess this is gonna be a Windows App.
What I would suggest is try to break up the modules and make specific components for that.
It will help you in assembling your application and would also be easier to maintain the same in future.
|
|
|
|
|
Thanks.
It will actually be a WPF application.
Can I build it as a regular app then convert it to a DLL?
|
|
|
|
|
Essentially an EXE is just a DLL with a static main method; both contain an assembly.
The classes in the assembly (if public) can be accessed by classes in other assemblies.
|
|
|
|
|
I am trying to create a Log Console that will be a hidden form that will called up when LogConsole.Show() is issued, and write to the Data Grid that is not bound by using the methods as defined. I never done anything like that and I need direction.
Take a look at the code below to get a feel for what i am trying to do.
namespace System.Diagnostics
{
public class LogConsole
{
public static readonly LogConsole Instance = new LogConsole();
private LogConsoleWrapper LogConsoleForm = new LogConsoleWrapper();
public void Show()
{
LogConsoleForm.Show();
}
public void Hide()
{
LogConsoleForm.Hide();
}
public void Focus()
{
LogConsoleForm.Focus();
}
public void WriteLine(string message)
{
LogConsoleForm.Write(message);
}
public void WriteLine(string message, bool error)
{
LogConsoleForm.Write(message, error);
}
public void WriteLine(string message, Exception ex)
{
LogConsoleForm.Write(message, (Exception)ex);
}
}
public class LogConsoleWrapper : System.Windows.Forms.Form
{
private System.ComponentModel.Container components = null;
static string sSource = "PIMSLite2008 Log Console";
static string sLog = "Application";
public LogConsoleWrapper()
{
InitializeComponent();
if (!EventLog.SourceExists(sSource))
EventLog.CreateEventSource(sSource, sLog);
clock.Start();
lblUser.Text = System.Environment.UserName.ToString().ToUpper();
}
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region User Defined Code
private void clock_Tick(object sender, EventArgs e)
{
lblDate.Text = DateTime.Now.ToShortDateString();
lblTime.Text = DateTime.Now.ToLongTimeString();
}
public void Write(string message)
{
string[] tmp = new string[3];
tmp[0] = DateTime.Now.ToLongTimeString() + " " + DateTime.Now.ToShortDateString();
tmp[1] = "N/A";
tmp[2] = message;
dgLog.Rows.Add(tmp);
}
public void Write(string message, bool error)
{
string[] tmp = new string[3];
tmp[0] = DateTime.Now.ToLongTimeString() + " " + DateTime.Now.ToShortDateString();
if (error == true)
{
tmp[1] = "Error";
}
else
{
tmp[1] = "Information";
}
tmp[2] = message;
dgLog.Rows.Add(tmp);
}
public void Write(string message, Exception ex)
{
string[] tmp = new string[3];
tmp[0] = DateTime.Now.ToLongTimeString() + " " + DateTime.Now.ToShortDateString();
tmp[1] = "Error";
tmp[2] = message;
dgLog.Rows.Add(tmp);
string errorMessage = "USER: " + System.Environment.UserName + "\r\n" + new String('-', 100) + "\r\nFUNCTION: " + System.Reflection.MethodBase.GetCurrentMethod().ToString() + "\r\n" + new String('-', 100) + "\r\nSOURCE: \r\n" + ex.Source + "\r\n" + new String('-', 100) + "\r\nMESSAGE: \r\n" + ex.Message + "\r\n" + new String('-', 100) + "\r\nCUSTOM MESSAGE:\r\n" + message + "\r\n" + new String('-', 100) + "\r\nSTACK TRACE: \r\n" + ex.StackTrace;
EventLog.WriteEntry(sSource, errorMessage, System.Diagnostics.EventLogEntryType.Error);
}
#endregion
|
|
|
|
|
I would try to declare it as a member of the Application class. Then, you can refer to it by accessing the application object. I believe you can get access to the application object anywhere in your code. I hope that helps.
|
|
|
|
|
I'm unclear as to what the problem is.
Public classes are available "throughout an entire project/application".
Is there a more specific problem you're encountering?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark brings up a good point. However, I think he needs a place to put an instantiated object of that class.
I know in WPF Applications there is a App.xaml.cs file that gives you access to the application object. However, I am not sure where to find the App.cs file in Windows Forms applications.
|
|
|
|
|
I'm still unclear how the OP title relates to the code
(mostly because my attention span won't let me read a code snippet
that big ), but the
public static readonly LogConsole Instance = new LogConsole();
makes "Instance" globally available since the LogConsole class is public.
I'm not sure what's not working
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Good point. Where would he declare it?
|
|
|
|
|
I copied that from the 5th line of his code
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
What is the difference between Excel2003 Addin and Excel2003 Workbook project in c#2008 ??????????
|
|
|
|
|
An Add-in provide more features or services to an application. So, basically an Excel Add-in will add more feature to our existing MS Excel Application.for eg: you may want to create and add-in which will post data to your web server.(this is just a crude example)
While a Excel project is nothing but creating a workbook through Visual Studio.
|
|
|
|
|
So, i want to develop my own toolbar which should get installed in excel 2003 and also i can distribute to any other machines, so which approach is better for that workbook or addin.
|
|
|
|
|
Mogaambo wrote: So, i want to develop my own toolbar which should get installed in excel 2003 and also i can distribute to any other machines, so which approach is better for that workbook or addin.
Addin
|
|
|
|
|
I have developed a exceladdin2003 using c#.net 2008 but unable to create the setup,
have u install exceladdin2003 using .net2008????
|
|
|
|
|
I have a webbrowser control in my desktop application and its background color and foreground colors are needed to be changed at runtime. How to achieve it. please send some sample code to do this.
Thanks
|
|
|
|
|
Look, the webbrowser control(or even a web browser) does not have a background color on its own.
It's basic purpose is to render the page it shows.
|
|
|
|
|
What you can do, is to update the displayed html page using Javascript
So you must make some changes and decision on how you display (generate) your html source.
|
|
|
|
|
Ok I pulled this from www.aspnettutorials.com I want to know if I can take this and make it a strong encryption method. I wanna be able basically to create a page that allows a text box then it encrypt it and saves it to the server. Then later another user can connect to the same page unencrypted and view what was written. Does that make any sense? I all so want to make the original page that the clear text is being sent to, encrypted as not to have it clear text method.I would post the whole script but it is very long.
http://aspnettutorials.com/tutorials/advanced/string-encrypt-vb.aspx
Thanks!
|
|
|
|
|
Hey Jackeli
"Strong encryption" methods are not something we just sit and come up with, There are cryptographers and cryptanalysts that this is what they're doing.
They come up with "Strong Encrpytions" (and try to break them...).
So if you want to use a "strong encryption", you just need to learn how to use one.
I'll try to explain a little bit about it, but before you get down to the code you need to plan a little bit how you're going to do what you want, that is, encrypt the given text in such a way only certain people will be able to see it.
I think what you are looking for is called "Symmetric encryption" (There are "ASymmetric encryptions" as well), so I'll explain a little bit about it (not technical stuff, but the idea, so you will understand better what you're going to do).
- "Symmetric encryption" means that if you encrypt text with a certain KEY, we need that exact KEY to decrypt. What is a KEY? it can be a password, passphrase, a file. In other words, a KEY is an array of bytes (byte[]).
using this KEY we encrypt and decrypt the text.
So if we'll look at the page you want to write, it means, that I can write a certain sentence, like: "This is my hidden message", and encrypt is using the password "Secret Password!".
Now, if I want you to read my message, you need to know the password. So I will need to tell you the password somehow, only then you can go to the website, and use the password "Secret Password!" and reveal the encrypted text: "This is my hidden message".
This is the tip of the ice burg.
Today's standard symmetric encryption is called "AES", and C# libraries are giving you a method that is doing just what you want (There are many other methods, but I think you should focus one).
Look for it a little bit in codeproject and you will find plenty of examples on how to do it, and other stuff I didn't quite got into in this example (the more technical stuff).
I hope it helped!
Good Luck!
|
|
|
|
|
If you read that article it points out quite clearly that it is not at all a good, secure method of encryption. It is a very simple substitution cypher which would be cracked in seconds by anyone with enough reason to do so and the right software.
If you want to learn more about encryption the .net framework has a number of classes you can utilise. I suggest a good google search[^] will provide you with tons of information.
|
|
|
|
|
Thanks to MatzeS (in his question 4 hours ago) I managed to put a form on a tabpage.
The form seems to operate allright, but in the datagridview on the form I miss the scrollbars
I use C# Express 2008
How can I make sure the scrollbars are showing ?
Rob
|
|
|
|