|
Mark Nischalke wrote: false statements
No, look, again I'll explain... You know about the two forms?
Well, I posted a solution following MY possibilities. There was a better solution for it. I can accept it, 'cause I'm beginner. Your opinion is "it's a false statement". So be it...
Mark Nischalke wrote: He will most likely signup with a new account and the same attitude anyway
Tell me, my friend, why should I signup again? I have this account. And what's wrong with my attitude? I've tried to help another, but you've attacked me directly. Again here, I ask a clear question. What's your answer? Again, "ow let's begin about his wrong solution". I'm sorry but I think it's not my attitude but yours...
And indeed I've said "bye bye", but I'm programmer in beginner stadium, I'll need this (or another) resource.
|
|
|
|
|
I don't think Mark has anything to apologize for. The OP was a secundary[sic] school putz.
Yes, newbies are welcomed here, but they have to show some self-awareness. Beyond that, whoever is paying this guy to come up with this code is in for a real (and disappointing) surprise.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
_Madmatt wrote: I can write it myself too but then I need a little tutorial with complete examples.
That's not the same as writing it yourself. You realise that any security system you write in a C# app can be defeated just by using reflection to view your code ? In any case, any publically available system is more likely to be cracked because
1 - everyone has the source code
2 - if a person works out how to break it, they've broken every app that uses it
Security systems are something you need to either pay for, or write yourself. If, as you say, you're teaching yourself, then good. Teach yourself. Work out how to do this, and do it. Don't copy and paste code off the web and congratulate yourself that you taught yourself to program.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
So if I understood, everyone can view my code? Then it's best that I use another language or a program that I'll have to buy?
And I didn't know that viewing the code from another in c# was that simple. However, I'll search and try to find a good and safe program to do the job.
I found the Shareware Starter Kit (SSK) from Microsoft, but they stopped the project.
Does someone still use that?
If someone uses software to protect his apps and wants to share that "secret" with me, tell me!
Christian Graus wrote: Don't copy and paste code off the web
I don't, I only use code from the web as basis to start with.
What do you think about www.intelliprotector.com ?
modified on Sunday, November 8, 2009 6:17 AM
|
|
|
|
|
_Madmatt wrote: So if I understood, everyone can view my code?</blockquote>
Yes, and my initial advice to you is to stop using <code>goto</code>.
_Madmatt wrote: I found the Shareware Starter Kit (SSK) from Microsoft, but they stopped the project.
Nobody with any experience uses Microsoft starter kits.
_Madmatt wrote: If someone uses software to protect his apps and wants to share that "secret" with me, tell me!
With the huge fan base you're accumulating here, I'm sure you won't have to wait too long for someone to assist you.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hello to everyone,
I want to develop Speech recognition application for vista and xp too, like if i say "Open Notepad", notepad should be open. For that i have use system.speech.recognition, but when i run my application, default speech recognition gets opened. My code is:
SpeechRecognizer rec = new SpeechRecognizer();
private void Form1_Load(object sender, EventArgs e)
{
Choices c = new Choices();
c.Add("Close");
c.Add("Pause");
c.Add("Stop");
var gb=new GrammarBuilder(c);
var g=new Grammar(gb);
rec.SpeechRecognized +=new EventHandler<SpeechRecognizedEventArgs>(rec_SpeechRecognized);
rec.LoadGrammar(g);
rec.Enabled=true;
}
private void rec_SpeechRecognized(Object sender, SpeechRecognizedEventArgs e)
{
MessageBox.Show(e.Result.ToString());
}
I am developing this application in vista, but i want this should be run also in xp.
Please help me for this,
Thank you in advance.
|
|
|
|
|
The problem is that you aren't loading the right grammar files. Instead of your own grammar file, try loading a new instance of the DictationGrammar class. Then invoke rec.RecogniseAsync(RecognitionMode.Multiple) . I'm not certain about this, but I think that rec should actually be a SpeechRecognitionEngine instance instead of a SpeechRecogniser.
If all that fails, then perhaps you could try calling SetInputToDefaultAudioDevice before you invoke RecogniseAsync.
|
|
|
|
|
Hi everybody!
I have a DirectoryTreeView app to display all images in the selected directory, including:
A TreeView include drives and directories.
All images have put into a FlowLayoutPanel.
When i click an image within it, this image will be display in a PictureBox.
My key matter is that when click an image in FlowLayoutPanel (called from FolderTreeViewAfterSelect method to pic_Click method by using EventHandler)
i also want to gain filename of this image to do more something in pic_Click method.
How could i get it? Please help me! Thank you so much!
Here's my code.
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
namespace DirectoryTreeView
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
void FolderTreeViewBeforeExpand(object sender, TreeViewCancelEventArgs e)
{
MainForm.ActiveForm.Cursor = System.Windows.Forms.Cursors.WaitCursor;
TreeNode currentnode= e.Node;
if (currentnode.Nodes.Count==1) currentnode.Nodes[0].Remove();
if (currentnode.Nodes.Count==0)
{
int step = 0;
DirectoryInfo di = new DirectoryInfo(currentnode.FullPath);
DirectoryInfo[] dirs = null;
try
{
dirs = di.GetDirectories();
}
catch(Exception ex)
{
}
foreach (DirectoryInfo dir in dirs)
{
currentnode.Nodes.Add(dir.Name);
DirectoryInfo[] subfolder;
try
{
subfolder = dir.GetDirectories();
}
catch (Exception ex)
{
continue;
}
if (subfolder.Length > 0)
{
currentnode.Nodes[step].Nodes.Add("");
}
step++;
}
}
MainForm.ActiveForm.Cursor = System.Windows.Forms.Cursors.Default;
}
void MainFormLoad(object sender, EventArgs e)
{
int step = 0;
foreach(string str in Directory.GetLogicalDrives())
{
folderTreeView.Nodes.Add(str);
folderTreeView.Nodes[step].Nodes.Add("");
step++;
}
}
void FolderTreeViewBeforeSelect(object sender, TreeViewCancelEventArgs e)
{
MainForm.ActiveForm.Text = e.Node.FullPath;
}
void FolderTreeViewAfterSelect(object sender, TreeViewEventArgs e)
{
MainForm.ActiveForm.Cursor=System.Windows.Forms.Cursors.WaitCursor;
thumbnailsFLP.Controls.Clear();
displayPictureBox.Image = null;
string[] Files = Directory.GetFiles(e.Node.FullPath);
thumbnailsFLP.Controls.Clear();
foreach (String fn in Files)
{
PictureBox pic = new PictureBox();
pic.SizeMode = PictureBoxSizeMode.StretchImage;
if (fn.ToLower().EndsWith(".jpg") || fn.ToLower().EndsWith(".GIF") || fn.ToLower().EndsWith(".png") || fn.ToLower().EndsWith(".bmp") || fn.ToLower().EndsWith(".jpeg"))
{
pic.Image = Image.FromFile(fn);
pic.Height = 100;
pic.Width = 100;
pic.Cursor = Cursors.Hand;
thumbnailsFLP.Controls.Add(pic);
pic.Click += new EventHandler(pic_Click);
}
}
MainForm.ActiveForm.Cursor=System.Windows.Forms.Cursors.Default;
}
void pic_Click(object sender, EventArgs e)
{
PictureBox pic = (PictureBox)sender;
displayPictureBox.SizeMode=PictureBoxSizeMode.StretchImage;
displayPictureBox.Image = pic.Image;
}
}
}
Code link:
http://www.fileden.com/files/2007/12/28/1667604/DirectoryTreeView.rar
|
|
|
|
|
Hi,
If I correctly understood your problem, you could store the filename in pic.Tag
Some comments:
1. there is a bug: GIF files won't work (typo)
2. you should never catch an unspecified exception and then ignore it; at the minimum log its ToString() result somewhere, maybe in a log file. The only ones that are fine to ignore, are very specific ones about which you don't care (such as not getting access to some folder, in your app).
3. isn't your app terribly slow on directories that contain lots of images?
4. you should call Dispose() on all the images and all the PictureBoxes you no longer need. This applies to thumbnailsFLP.Controls.Clear(); (of which you have 2!).
5. pic.Image = Image.FromFile(fn); locks the file, so you can't delete the image file while the PB is present on your Form. The solution is to use Image.FromStream().
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Thanks so much for your help! I've got it!
I will try to correct my code more properly according to your guide.
Thank you so much for another time!
Have a nice day!
|
|
|
|
|
Hi,
I have been thinking... Let's assume that I have a server application and lots of clients all over the world connect to my server by using TCP protocol. When a client sends me a connection request, my server application creates a thread for the client and do the rest of the communication in that thread. As far as I know, after some number of threads, operating system starts to get mad and refuses to create more threads. This causes my application to deny to service.
How is this problem solved? Am I missing a point?
Thanks in advance.
|
|
|
|
|
Use asynchronous methods instead of synchronous ones (i.e. use BeginReceive instead of Receive ). This allows you to not have to explicitly create/destroy a thread for each connected client; instead, the async callbacks are executed on Thread Pool threads which are managed by the runtime.
The code required to implement an async client/server can be more complex than the alternative but it solves this specific problem. Once you spend some time and really get familiar with the async way of doing things the complexity will cease to be a factor and you won't know how you lived without it .
|
|
|
|
|
As suggested, asynchronous methods can solve this problem. But you should be very careful when using it. It can make your code unnecessarily complicated. IMO, you should choose it only when it is necessary.
I'd suggest to use a thread pool rather than creating new thread each time. It should scale well in most scenarios. For more scalability than that, asynchronous method is the way to go.
Best wishes,
Navaneeth
|
|
|
|
|
Hi
I have the code to make the backup of the MySql database like this..
try
{
DateTime backupTime = DateTime.Now;
int year = backupTime.Year;
int month = backupTime.Month;
int day = backupTime.Day;
int hour = backupTime.Hour;
int minute = backupTime.Minute;
int second = backupTime.Second;
int ms = backupTime.Millisecond;
String tmestr = backupTime.ToString();
tmestr = "C:\\" + year + "-" + month + "-" + day + "-" + hour + "-" + minute + ".sql";
StreamWriter file = new StreamWriter(tmestr);
ProcessStartInfo proc = new ProcessStartInfo();
string cmd = string.Format(@"-u{0} -p{1} -h{2} {3} > {4};", "root", "password", "localhost", "dbfile", "backup.sql");
proc.FileName = "mysqldump";
proc.RedirectStandardInput = false;
proc.RedirectStandardOutput = true;
proc.Arguments = cmd;//"-u root -p smartdb > testdb.sql";
proc.UseShellExecute = false;
Process p = Process.Start(proc);
string res;
res = p.StandardOutput.ReadToEnd();
file.WriteLine(res);
p.WaitForExit();
file.Close();
}
catch (IOException ex)
{
MessageBox.Show("Disk full or other IO error , unable to backup!");
}
}
while executing the program it is showing an error like
"The system cannot find the file specified" with caption "Win32Exception was unhandled "...
can anyone help in this.....
|
|
|
|
|
you can change the mysqldump file path like
C:\wamp\bin\mysql\mysql5.1.36\bin\mysqldump
for the using wamp server;
|
|
|
|
|
what is the use in Xampp server
|
|
|
|
|
hello all
i want to know how to get DateTime array through DataReader and set it as bolded Dates on MonthCalender
i have the following code ..
SqlCommand GetDates = new SqlCommand();
GetDates.Connection = new SqlConnection(ConS);
GetDates.CommandType = CommandType.Text;
GetDates.CommandText = "select Reserve_Date from reservations where Done = 0";
GetDates.Connection.Open();
SqlDataReader rd = GetDates.ExecuteReader();
while (rd.Read())
{
DateTime ReservDays = (DateTime)rd["Reserve_Date"];
monthCalendar1.AnnuallyBoldedDates = new DateTime[] { ReservDays };
}
rd.Close();
GetDates.Connection.Close();
the reader works fine but the result is the last row only
i want to get all rows and set it as AnnuallyBoldedDates on monthCalender
thanks in Advance
|
|
|
|
|
Mr.Kode wrote: the reader works fine but the result is the last row only
Because you are overwriting the variable in each iteration. You need to get everything into an array and finally set to monthCalendar1.AnnuallyBoldedDates . Since you don't know the number of items, it is easy to use a List .
var list = new List<DateTime>();
while (rd.Read())
{
DateTime ReservDays = (DateTime)rd["Reserve_Date"];
list.Add(ReservDays);
}
monthCalendar1.AnnuallyBoldedDates = list.ToArray(); Your code can be improved further by calling Dispose() on SqlConnection, command and reader.
Best wishes,
Navaneeth
|
|
|
|
|
thanks Navaneeth
this really helps
but how Dispose method improve performance?
|
|
|
|
|
Performance is not the reason to call Dispose . It avoids resource leaks. When you dispose your connection properly, ADO.NET's connection pooling can work efficiently. Here is a decent article on the subject : Implementing IDisposable and the Dispose Pattern Properly[^]
Best wishes,
Navaneeth
|
|
|
|
|
Your statement "monthCalendar1.AnnuallyBoldedDates = new DateTime[] { ReservDays };" recreates the array on each iteration.
And also, the statement "DateTime ReservDays = (DateTime)rd["Reserve_Date"];" is needless.
I also recommend using a try/finally, with the rd.Close() in the finally. And a using statement for the connection.
|
|
|
|
|
how do i call a c# funcation in html code, on link's onclick?
i have already called a function onclick, i need to call another function.
kindly help me out....
Thanks
Saurabh
|
|
|
|
|
Assuming I understand your question you just need to name the second function as something else, e.g. OnClickTwo() .
btw please do not use bold font for your question.
|
|
|
|
|
Firstly, try such questions in the ASP.NET forum - you are more likely to get usefull replies.
I assume you are trying to call a C# function in the code behind (server code)? In which case just make the link runat="server" and the onclick event should pick up C# code.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
As someone else said, we have an ASP.NET forum. I hate to say this, because it's a library overused by all sorts of clueless people, but AJAX may be what you're looking for. The alternative is simply to have a server control call a code behind method and do a postback.,
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|