|
No.
Sorry, but I am not in the habit of downloading and executing unknown files from strangers. Would you?
Try describing things, instead of expecting us to download a program that could do anything when we run it...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Ok, I know how it sounds, but I assure you that is not a virus or anything dangerous.
It's a simple project that is in testing form. Nothing more.
Its faster and simpler to view what i have done than to explain.
I really need some help from you guys.
Give me an alternative and I will try to make it.
Thank you.
|
|
|
|
|
merlinq12 wrote: I assure you that is not a virus or anything dangerous.
But you would say that, wouldn't you?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Ok, you want to upload the project?
Ill do it, but you must put manually in Debug directory a couple of text files, some pdf's, some docx, and html, convert them all to *.txt files, compile the program and see how it read and why. The "readme.txt" file is posted here already, so you must read it first that to understand my problem.
Now I will upload the project to the only site I know sendspace.com , but if you know others in wich you trust more, tell me and I will upload through them.
thank you.
|
|
|
|
|
It not that I don't trust the site it is coming from, it's that I don't trust the content!
Without examining your source code in some detail, I cannot be sure that there is nothing in there which will potentially do something nasty. As a result, I am not going to download anything from anywhere!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Ok, no problem, Ill give you the code, but not about it is the problem, but the feeling of the program itself and what it does... I really cant have words to explain better.
here is the entire project source: http://www.sendspace.com/file/vg2fq5
and here is its content:
Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
using System.Reflection;
namespace testu3
{
public partial class Form1 : Form
{
public List<testu4.UserControl1> UC = new List<testu4.UserControl1>();
List<string> lrtb = new List<string>();
string path = Application.StartupPath;
int oneAfter = 0, posTxt = 0, multiFile = 0;
}
}
xEvents.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
namespace testu3
{
public partial class Form1
{
public Form1()
{
InitializeComponent();
userControl0Test.Visible = false;
}
private void Form1_Load(object sender, EventArgs e)
{
DirectoryInfo di = new DirectoryInfo(path);
foreach (var item in di.GetFiles())
{
if (item.Extension.ToLower() == ".txt")
{
testu4.UserControl1 uc = new testu4.UserControl1();
uc.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
uc.Location = new Point(10, oneAfter);
uc.linkLabel0.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabelUC_LinkClicked);
uc.linkLabel1.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabelUCopen_LinkClicked);
uc.linkLabel0.Text = item.Name;
#region <_____ OPENfile _____>
foreach (var item1 in di.GetFiles())
{
string original = item.Name.Replace(".txt", "");
if (multiFile == 0)
{
if (item1.Name.Contains(original))
{
uc.linkLabel1.Links[0].LinkData = uc.linkLabel0.Text;
multiFile++;
}
}
if (multiFile > 0)
{
if (item1.Extension != ".txt")
{
if (item1.Name.Contains(original))
{
uc.linkLabel1.Links[0].LinkData = item1.FullName;
}
}
}
}
multiFile = 0;
#endregion >OPENfile-END<
uc.richTextBox1.Text = item.OpenText().ReadToEnd();
panel0.Controls.Add(uc);
UC.Add(uc);
oneAfter += uc.Height;
string pureName = item.Name.ToLower().Replace(".txt", "");
linkLabel0.Text += pureName + " | ";
linkLabel0.Links.Add(linkLabel0.Text.IndexOf(pureName), pureName.Length, item.FullName);
}
}
int indexOfNext = linkLabel_BackNext.Text.IndexOf("Next");
linkLabel_BackNext.Links.Add(0, 4);
linkLabel_BackNext.Links.Add(indexOfNext, 4);
}
private void button0Search_Click(object sender, EventArgs e)
{
panel0.Controls.Clear(); UC.Clear(); oneAfter = 0; linkLabel0.Links.Clear();
DirectoryInfo di = new DirectoryInfo(path);
foreach (var item in di.GetFiles())
{
if (item.Extension.ToLower() == ".txt")
{
posTxt = 0;
string searchText = textBox1.Text.ToLower();
if (item.Name.ToLower().Contains(searchText))
{
string pureName = item.Name.ToLower().Replace(".txt", "");
linkLabel0.ForeColor = Color.Gray;
linkLabel0.Links.Add(linkLabel0.Text.IndexOf(pureName), pureName.Length, item.FullName);
}
StreamReader sr = new StreamReader(item.FullName);
string alltxt = sr.ReadToEnd();
if (alltxt.ToLower().Contains(searchText))
{
#region <_____ addControls _____>
testu4.UserControl1 uc = new testu4.UserControl1();
uc.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
uc.Location = new Point(10, oneAfter);
uc.Size = new System.Drawing.Size(panel0.Width, uc.defaultHeight);
uc.linkLabel0.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabelUC_LinkClicked);
uc.linkLabel1.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabelUCopen_LinkClicked);
uc.linkLabel0.Text = item.Name;
#region <_____ OPENfile _____>
foreach (var item1 in di.GetFiles())
{
string original = item.Name.Replace(".txt", "");
if (multiFile == 0)
{
if (item1.Name.Contains(original))
{
uc.linkLabel1.Links[0].LinkData = uc.linkLabel0.Text;
multiFile++;
}
}
if (multiFile > 0)
{
if (item1.Extension != ".txt")
{
if (item1.Name.Contains(original))
{
uc.linkLabel1.Links[0].LinkData = item1.FullName;
}
}
}
}
multiFile = 0;
#endregion >OPENfile-END<
#endregion >addControls-END<
#region <_____ Context _____>
if (button1Concentrated.Text == "Concentrated")
{
uc.richTextBox1.Text = alltxt.ToLower();
while (posTxt != -1)
{
posTxt = uc.richTextBox1.Find(searchText, posTxt, RichTextBoxFinds.MatchCase);
if (uc.richTextBox1.SelectedText == searchText)
{
uc.richTextBox1.SelectionLength = searchText.Length;
uc.richTextBox1.SelectionColor = Color.Red;
}
posTxt = uc.richTextBox1.Find(searchText, posTxt + 1, RichTextBoxFinds.MatchCase);
}
}
#endregion >Context-END<
#region <_____ Concentrated _____>
if (button1Concentrated.Text == "Context")
{
uc.richTextBox1.Text = alltxt.ToLower();
for (int i = 0; i < uc.richTextBox1.Lines.Length; i++)
{
if (uc.richTextBox1.Lines[i].Contains(searchText))
{
string line = "[line:" + (i + 1) + "/" + uc.richTextBox1.Lines.Length + "] " + uc.richTextBox1.Lines[i];
lrtb.Add(line);
}
}
uc.richTextBox1.Text = "";
foreach (var item1 in lrtb)
{
uc.richTextBox1.Text += item1 + "\r\n";
}
while (posTxt != -1)
{
posTxt = uc.richTextBox1.Find(searchText, posTxt, RichTextBoxFinds.MatchCase);
if (uc.richTextBox1.SelectedText == searchText)
{
uc.richTextBox1.SelectionLength = searchText.Length;
uc.richTextBox1.SelectionColor = Color.SpringGreen;
}
posTxt = uc.richTextBox1.Find(searchText, posTxt + 1, RichTextBoxFinds.MatchCase);
}
}
#endregion >Concentrated-END<
panel0.Controls.Add(uc);
UC.Add(uc);
oneAfter += uc.Height;
lrtb.Clear();
}
}
}
}
public void linkLabelUC_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
for (int i = 0; i < UC.Count; i++)
{
if ((i + 1) < UC.Count)
{
int firstHeight = UC[i].Height;
int firstPosition = UC[i].Location.Y;
int secondHeight = UC[i + 1].Height;
int secondPosition = UC[i + 1].Location.Y;
if (firstPosition == 0)
{
UC[i + 1].Location = new Point(10, firstHeight);
}
if (firstPosition != 0)
{
UC[i + 1].Location = new Point(10, firstHeight + firstPosition);
}
}
}
}
private void linkLabel0ShowAll_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
for (int i = 0; i < UC.Count; i++)
{
if (UC[i].richTextBox1.Lines.Length > 1)
{
if (UC[i].linkLabel0.LinkVisited)
{
UC[i].Height = UC[i].defaultHeight;
UC[i].linkLabel0.LinkVisited = false;
linkLabel0ShowAll.Text = "Show All";
}
else
{
UC[i].Height = UC[i].Height + (UC[i].richTextBox1.Lines.Length * UC[i].richTextBox1.Font.Height);
UC[i].linkLabel0.LinkVisited = true;
linkLabel0ShowAll.Text = "Close All";
}
}
if ((i + 1) < UC.Count)
{
int firstHeight = UC[i].Height;
int firstPosition = UC[i].Location.Y;
int secondHeight = UC[i + 1].Height;
int secondPosition = UC[i + 1].Location.Y;
if (firstPosition == 0)
{
UC[i + 1].Location = new Point(10, firstHeight);
}
if (firstPosition != 0)
{
UC[i + 1].Location = new Point(10, firstHeight + firstPosition);
}
}
}
}
void linkLabelUCopen_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
string target = e.Link.LinkData as string;
if (null != target) System.Diagnostics.Process.Start(target);
}
private void linkLabel0_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
this.linkLabel0.Links[linkLabel0.Links.IndexOf(e.Link)].Visited = true;
string target = e.Link.LinkData as string;
if (null != target) System.Diagnostics.Process.Start(target);
}
private void button1Concentrated_Click(object sender, EventArgs e)
{
if (button1Concentrated.Text == "Concentrated")
{
button1Concentrated.Text = "Context";
button0Search.PerformClick();
}
else
{
button1Concentrated.Text = "Concentrated";
button0Search.PerformClick();
}
}
}
}
UserControl1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace testu4
{
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
private void UserControl1_Load(object sender, EventArgs e)
{
label0.Location = new Point(linkLabel0.Location.X + linkLabel0.Width, linkLabel0.Location.Y + 4);
}
public int defaultHeight = 55;
private void linkLabel0_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (richTextBox1.Lines.Length > 1)
{
if (linkLabel0.LinkVisited == false)
{
this.Height = this.Height + (richTextBox1.Lines.Length * richTextBox1.Font.Height);
linkLabel0.LinkVisited = true;
}
else
{
this.Height = defaultHeight;
linkLabel0.LinkVisited = false;
}
}
}
private void groupBox1_MouseHover(object sender, EventArgs e)
{
}
private void richTextBox1_MouseHover(object sender, EventArgs e)
{
}
}
}
|
|
|
|
|
|
Sorry for the trouble, but you look over it?
Any thoughts about it?
thanks.
|
|
|
|
|
Well, I really couldn't be bothered to read through all your code here, but a couple of things stood out on the quick look through I performed. In your Form_Load in Form1 (bad name by the way, you should try to rename your main components to be meaningful - you've got a lot of default names scattered about), you read the file details in; that's potentially going to be a long running operation so you should look to improve the user experience by running that on a thread.
Also, you have lots and lots of nested if statements, you could use short-circuit logic to make your code a bit more compact.
|
|
|
|
|
|
Hi all,
I can detect face and specific color using c# and open cv.
I hardly need code/ link/ help to detect teeth using c# and openCV.
Waiting for your helps.
|
|
|
|
|
AhmedMasum wrote: I hardly need code/ link/ help
If you hardly need it, why are you asking?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
sorry for using the wrong words.
Actually I really need this..
|
|
|
|
|
And what if the image has no teeth?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Then just brush it off.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
I don't want teeth near my ARM.
|
|
|
|
|
if there is not teeth then it will show a message.
But if it detect teeth then it will show another message.
|
|
|
|
|
Still not got any good solution..
|
|
|
|
|
You need to spend some time thinking about this. How exactly do you think a computer can figure out the difference between a portion of a face and a tooth or teeth? This is all about image analysis which is not a simple matter of writing a few lines of code. Try looking at some of the articles on this subject here on CodeProject and on the wider internet.
I must get a clever new signature for 2011.
|
|
|
|
|
Thanks for your suggestion.
There are lots of online help for detecting face. There are some API to detect face from an image.
But I am not getting any efficient code to detect teeth from face using c#.
I am reading different articles but still can't code them.
thanks.
|
|
|
|
|
AhmedMasum wrote: But I am not getting any efficient code to detect teeth from face using c#.
Probably because it is very difficult to recognise where face ends and teeth begin. This is something like spectral analysis but without the accuracy.
I must get a clever new signature for 2011.
|
|
|
|
|
First find the mouth. Then use an edge-detection algorithm to find boundaries. The lips and teeth will be bounded by edges where the darkness changes. If you have color images, this will give you more information you can use to find edges. The bounded regions between the lips are probably teeth.
|
|
|
|
|
I need to suppress a DOS window when when calling XCOPY from a C# application
|
|
|
|
|
Try ProcessWindowStyle.Hidden:
Process p = new Process();
p.StartInfo.Arguments = @"F:\Temp F:\Temp2\";
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.FileName = "XCOPY";
p.Start();
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
Spot on!
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|