|
OK - well, your only other option is to store the text in something like an XML file that you maintain. A DB would definately be easier.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
yes i store those image descriptions to a HTML
System.IO.FileStream newFile = new System.IO.FileStream(Server.MapPath(sSavePath + sFilename), System.IO.FileMode.Create);<br />
newFile.Write(myData, 0, myData.Length);<br />
newFile.Close();<br />
TextWriter tw = new StreamWriter(Server.MapPath("Images/Saved Images/" + sFilename + ".html"));<br />
<br />
tw.WriteLine("<html>");<br />
tw.WriteLine("<img src=\"" + sSavePath + sFilename + "\">" + " " + "<desc=\"" + desc.Text + "\">" + " " + "<mat=\"" + materials.Text + "\">" + " " + "<date=\"" + date.Text + "\">");<br />
tw.WriteLine("</html>");<br />
<br />
tw.Close();
right now i have to solve this function... and next is the toughest part since not using DB.. which is the Searching
|
|
|
|
|
Well, that's not much use. A single XML file with all your metadata is the most sensible way to do non DB search.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
ok i got you... a single XML with all my metadata.. but i remember teacher mentioning about each image file -> each html .. nevertheless, is there any keyword i shld search online for any guide or maybe u could provide some...?
|
|
|
|
|
I would expect that having a single XML file with the file path as the key to storing/updating data would be best. The XmlDocument class is the way to parse XML and XPath is the language you use to do that. If you have a bunch of HTML files, then you can load those as XML, if it's XHTML, but how do you write the code to search ? Sounds messy. A single file with all the metadata, which you can then search, seems best, although it's a long way away from the ease of doing it with a database.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi,
sorry to post again lol.
is there a basic code sample or guide for html search/parse/display?
on this search.aspx.. i have to do a search function whereby it'll search/parse my HTML files and look inside their's metadata for eg <desc> and then display a link to the HTML file.
my html basically looks like:
ImageFilename.html
|
|
|
|
|
Hi, the following code is about getting the right thread to run something left stoped before.
No need help here
private void AppendToRichEditControl(string msg)
{
if (InvokeRequired)
{
object[] pList = {msg}; // this line here
richTextBoxReceivedMsg.BeginInvoke(new UpdateRichEditCallback(OnUpdateRichEdit), pList);
}
else
{
OnUpdateRichEdit(msg);
}
}
private void OnUpdateRichEdit(string msg)
{
richTextBoxReceivedMsg.AppendText(msg);
}
What i want to now is why the use of the {}? why not ()? its wierd.
|
|
|
|
|
Because {} is the syntax for creating an array. IF you had more than one element it may be more clear
object[] pList = {msg, msg2, new object()}; // creates an array with three elements
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
nelsonpaixao wrote: What i want to now is why the use of the {}? why not ()? its wierd.
Consider the code below:
<br />
int[] numbers = new int[] {1, 2, 3, 4, 5};<br />
This would initalise an array of 5 data locations (i.e int[4]).
The values would be set to the following:
numbers[0] = 1
numbers[1] = 2
numbers[2] = 3
numbers[3] = 4
numbers[4] = 5
|
|
|
|
|
The documents says right click on class in 'class view' and click on 'add > method'. I do not see this option.
Thanks
|
|
|
|
|
Even if such a method existed, you'd do better to learn to code. Just type your method in.
Odds are it's not in the express edition or something.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
coding by hand is always fun but at least if the documentation says something, we should expect it to happen. And then wizards speed up things a little too. I am using VS team suite.
|
|
|
|
|
sharp_k wrote: 'add > method'
You can only add classes using the class view.
Cheers,
|
|
|
|
|
I don't know what documents you are referring to, but you cannot add methods using the "Class View" window. I think what the documents are referring to is the class diagram. You can right click the model of the class in the diagram and choose Add->Method.
|
|
|
|
|
It is in MSDN. Yes i did try the class diagram and it works there but as a previous VC++ user, I thought C# will provide the same functionality as well.
|
|
|
|
|
I'm getting issues while validating the phone number entry...i applied validation so that user could enter only digits as phone no...however it is creating problem if user acidently clicks in ph no box & tries to go to another entry...user gets error msg----"pleaseenter digits only" for even name !!!
|
|
|
|
|
Get it to not validate on an empty entry. A validator should have a field for that.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Simple return without doing anything from your validation function.
you can do that by checking the text if it is empty do nothing.
|
|
|
|
|
I have two classes (of my own creation) that I instantiate in my app.
public partial class MyForm
{
MyObject1 m_myObject1;
MyObject2 m_myObject2;
}
I have another class (ThreadData) that contains objects of those two classes as well (and I use the same names for the variables in this class as I do in the app).
public class ThreadData
{
MyObject1 m_myObject1;
MyObject2 m_myObject2;
}
In a function, I create an instance of ThreadData, and use clones of the app's objects to set the objects in ThreadData. When I try to compile, I get this message:
error CS0052: Inconsistent accessibility: field type 'MyForm.MyObject1' is less accessible than field 'MyForm.ThreadData.m_myObject1'
Even if I don't use Clone(), it still gives me the same errors. Why?
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
What's the accessibility on your MyObject1 type? m_myObject1 is public, so basically MyObject1 has to be the same.
|
|
|
|
|
Here's a better example of what I'm doing.
public class MyObject1 {}
public class MyObject2 {}
public class MyData
{
public MyObject1 myObj1;
public MyObject2 myObj2;
public SetData(MyObject1 ojb1, MyObject2 obj2)
{
myObj1 = obj1;
myObj2 = obj2;
}
}
public partial class MyForm
{
private MyObject1 myObj1;
private MyObject2 myObj2;
private void MyFunction()
{
MyData data = new MyData();
data.SetData(myObj1, myObj2);
}
}
That should be perfectly okay.
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
That compiles for me. Is that the exact code?
www.wickedorange.com
www.andrewvos.com
|
|
|
|
|
It basically means that m_myObject1 is accessible, but its type, MyObject1 , is not. Something like
internal class B
{
}
public class A
{
public B b;
}
In the example above, A.b is public, but the class B is not.
|
|
|
|
|
What does "shelve" and "unshelve" mean exactly in TFS?
I am accustomed to VSS with "undo changes."
|
|
|
|
|
Hi,
Can someone help me with this scenario please.
I need to hard code the comparison of a double with the double value returned from a datatable.
The user is using a language that has the comma as a decimal separator.
double dbValue = <gets the="" value="" from="" table="" and="" returns="" it="" as="2,1">
if(dbValue < 2.1) then blah blah blah
How do I hard code the "2.1" value or is there some way to globally have .net do this.
Thanks,
|
|
|
|