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 and then display a link to the HTML file. my html basically looks like: ImageFilename.html
Thomas Toh
Posts
-
is this coding correct? -
is this coding correct?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...?
-
is this coding correct?yes :) i store those image descriptions to a HTML
// Save the stream to disk System.IO.FileStream newFile = new System.IO.FileStream(Server.MapPath(sSavePath + sFilename), System.IO.FileMode.Create); newFile.Write(myData, 0, myData.Length); newFile.Close(); TextWriter tw = new StreamWriter(Server.MapPath("Images/Saved Images/" + sFilename + ".html")); // write a line of text to the files tw.WriteLine("<html>"); tw.WriteLine("<img src=\"" + sSavePath + sFilename + "\">" + " " + "<desc=\"" + desc.Text + "\">" + " " + "<mat=\"" + materials.Text + "\">" + " " + "<date=\"" + date.Text + "\">"); tw.WriteLine("</html>"); // close the stream tw.Close();
right now i have to solve this function... and next is the toughest part since not using DB.. which is the Searching :) -
is this coding correct?i'm not sure whether the teacher is dumb or what lol. personally i think DB is so much easier and i have no idea why she said it's unnecessary not needed. well, i guess i'd have to follow your path lol.i rougly know your idea.. is there a website guide that you could show me so that I can follow the guide?
-
is this coding correct?thanks but i don't quite understand your sentence "However, once you've done a postback, your chance for javascript validation is over" it's a school project.. no idea as teacher said DB is unnecessary..is there any other way? i've done a simple but not yet complete code lol...
if (System.IO.File.Exists(Server.MapPath(sSavePath + sFilename))) { Response.Write("<script type=\"text/javascript\">var result = confirm('Image already existed. Click OK to overwrite. Click NO for new filename.')</script>"); }
-
is this coding correct?ok finally thanks for ur constructive response......... so it's possible to use javascript on asp.net for that? im doing a simple website that allows users to upload image (simply copy/paste image from other folders to my application/images folder). also additional functions.. one of them is to validate whether the image i'm going to upload already existed.. if yes, ask user for input yes/no, if yes overwrite, if no, change a new filename. i downloaded the sourcecode from here http://www.codeproject.com/KB/aspnet/netimageupload.aspx also from there modify. atm im stuck at this function... later i'll have to do a Search function on the webpage. that is to search via descriptions/properties of the image not just the filename and i'm not allowed to use DB for that (tho its quite easier right)?
-
is this coding correct?ok i'll rephrase my question, i'm doing asp.net with c#. for this particular function, i need to use VB input box in c# to validate user input. i've read http://www.mdibb.net/net/using\_the\_visual\_basic\_input\_box\_in\_c/ but it doesnt seem to work as it says MessageBox.show does not exit in current context. PS: christian, if you don't feel like answering is ok, no one is forcing you. and btw this forum doesn't state its not for beginners. if you have no patience teaching, then don't. ;P
-
is this coding correct?heh i might missed the entry, sorry about that. i know i'm not an expert but please at least if you're not gonna provide something constructive, then shut it. for sure a book may help but if thats the option i wouldn't post here lol.
-
is this coding correct?string sFilename = System.IO.Path.GetFileName(myFile.FileName); string ans; while (System.IO.File.Exists(Server.MapPath(sSavePath + sFilename))) { Console.Write("Do you want to overwrite? (Yes/No)"); ans = Console.ReadLine(); Console.WriteLine(""); while (ans = Yes) { } logic: check if image already existed when uploading, if yes, ask user for input yes/no, if yes overwrite, if no, change a new filename. im lost.. plz help
-
Prompt user for Input1.sorry but what do you mean by server application? i'm doing asp.net c#.. images upload 2. oh path.combine works too? oh so ty lol
-
Prompt user for Input// Make sure a duplicate file doesn’t exist. If it does, keep on appending an incremental numeric until it is unique string sFilename = System.IO.Path.GetFileName(myFile.FileName); string ans; while (System.IO.File.Exists(Server.MapPath(sSavePath + sFilename))) { Console.Write("Do you want to overwrite? (Yes/No)"); ans = Console.ReadLine(); Console.WriteLine(""); } lblOutput.Text = "File already existed. A duplicate file has been created"; the logic is upload file -> if file exists -> prompt for user input -> if yes -> overwrite -> if no prompt for user input for new file name the code is not finished.. but am i on the right path??
-
Need Help on Writing to New Line// Save the stream to disk System.IO.FileStream newFile = new System.IO.FileStream(Server.MapPath(sSavePath + sFilename), System.IO.FileMode.Create); newFile.Write(myData, 0, myData.Length); newFile.Close(); TextWriter tw = new StreamWriter(Server.MapPath("Images/Saved Images/info.txt")); // write a line of text to the files tw.WriteLine(txtFName.Text + " " + txtLName.Text + " " + IDTextBox.Text + " " + sSavePath + sFilename); // close the stream tw.Close(); it works but whenever i try to upload 2 or more files/images... it will just overwrite the exisiting texts.. how do i make it such that it will create a new line each time i upload an image upon the existing ones?
-
Help on Writing Image Information(Location/Descriptions) to a txtfileok thanks... also.. if i write 2 or more image files... it will overwrite the exisiting one... how do i make it so that it will write onto next line in my textfile
-
Help on Writing Image Information(Location/Descriptions) to a txtfilethanks.. the second one works.. however.. for the first one... is this the correct code? TextWriter tw = new StreamWriter("Server.MapPath/images/info.txt"); also.. if i write 2 or more image files... it will overwrite the exisiting one... how do i make it so that it will write onto next line in my textfile
modified on Thursday, May 1, 2008 9:52 AM
-
Help on Writing Image Information(Location/Descriptions) to a txtfile// Save the stream to disk System.IO.FileStream newFile = new System.IO.FileStream(Server.MapPath(sSavePath + sFilename), System.IO.FileMode.Create); newFile.Write(myData, 0, myData.Length); newFile.Close(); TextWriter tw = new StreamWriter("d://fyp//images//saved images//info.txt"); // write a line of text to the file tw.WriteLine("txtFName.txt*txtLName*IDTextBox*" + sSavePath + sFilename); // close the stream tw.Close(); on the TextWriter tw = new StreamWriter("d://fyp//images//saved images//info.txt"); how do i specify the directory so that it will save to /images on my project folder? without specifying the exact location? also on the tw.WriteLine("txtFName.txt*txtLName*IDTextBox*" + sSavePath + sFilename); the result on the notepad is that it writes exactly the same text to the notepad... how do i make it so that i'll save whatever I input onto my textboxes?
-
!!! Plz Help, Project Required Uploading Images with adding Texts/Descriptions !!lol sorry... well guess what i've found the code... http://forums.asp.net/p/1121501/2331341.aspx#2331341 ... it works great for me... however is there a way to display the saved images together with the descriptions
-
!!! Plz Help, Project Required Uploading Images with adding Texts/Descriptions !!sorry guys if i sound rude but im really desperately in need of help as im not good in programming and my due date is within weeks..... i've downloaded http://www.codeproject.com/KB/aspnet/netimageupload.aspx and tried the source codes on Visual Studio 2005. it works.. (solved access denied directory) now i need to do an addition function which allows me to add descriptions/text/information attached to that image and saved it on either HTML/notepad.. i'm lost.. please help.............
-
!!! Plz Help, Project Required Uploading Images with adding Texts/Descriptions !!thanks for the input, appreciate it. however between C# and VB.Net.. which is a better choice? (as in which language is easier) also, is there a need for usage of SQL server? cos i remember my lecturer told me there's no need to. and.. how about microformats -- XFN? lol waiting for reply again :P
-
!!! Plz Help, Project Required Uploading Images with adding Texts/Descriptions !!hi all experts, as i'm new to this, can someone plz advice me? my project requirements: 1. images upload with adding texts/descriptions attached to it (save it in notepad/html??) using microformats (not too sure also as need details from lecturer) 2. search images via information in the notepad/html saved to the images 3. display searched results images should i use C#, VB, C++ for this project? as i want to start on the right path... can someone plz refer to any guide? i've found this: http://www.codeproject.com/KB/aspnet/netimageupload.aspx is this the right on to start on? so i can add on later... please help thanks a million.. waiting on your reply!! my email/MSN : narmon@gmail.com plz help :)
-
!!! Plz Help, Project Required Uploading Images with adding Texts/Descriptions !!hi all experts, as i'm new to this, can someone plz advice me? my project requirements: 1. images upload with adding texts/descriptions attached to it (save it in notepad/html??) using microformats (not too sure also as need details from lecturer) 2. search images via information in the notepad/html saved to the images 3. display searched results images should i use C#, VB, C++ for this project? as i want to start on the right path... can someone plz refer to any guide? i've found this: http://www.codeproject.com/KB/aspnet/netimageupload.aspx is this the right on to start on? so i can add on later... please help thanks a million.. waiting on your reply!! my email/MSN : narmon@gmail.com plz help :)