May 2004 - Posts

A array with a string index

Hey all,

So after starting on my search engine i came to the conclusion that i needed a array with a string indexer(more about how i builded my search engine when i have some more time :D). So i was thinking a Hashtable (System.Collections.Hashtable) but there was one problem it was not possible to edit a item easily :( So i had to look on and found:

System.Collections.Specialized.NameValueCollection

Witch is basily a array with a string indexer :D

Stupid post aint it :) Happy Netting

 

Search enginen problem/help?!?

Hey all,

So i have my urls in the right way for a spider search engine like google and all works pritty good one problem i have now is what kind of a search engine should i use/build for the site?

I have to think about what the server can handel because it is a shared server with other sites.
My consurn is that if i use a spider engine that spiders everytime someone searches the site that this will overload the server in some kinda way. And the problem is that i can't use a crawler because that won't find all the products, brands and categorys.So the last kinda engine i could build is a database driven one.

Problem with the last one is i don't have a clou how to make a good one that indexs words in a good way and then there is still the part of letting it only search thru products or brands or categorys.

Anyway if someone has a good idee that could help me for a search engine give me a mail/comment :D

Here are 2 links about the way to build a search engine:

Hope some one can help :D

Happy Netting

ItemDataBound stupid mistake between e.Item.ItemIndex and e.Item.DataSetIndex

Hi there :)

Ok yet again a small problem :(
I had a very nice datagrid with info in it a ItemDataBound to show the pricture the right way and it was great :D
But then there came the evil paging *i was scared* and when i went to page to the images wheren't right anymore!!
There was no darn reson i could find.......
The code with the error:
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemIndex >= 0)
{
string ID = dataSetProduct1.product[e.Item.ItemIndex].productID.ToString();
HyperLink picture = e.Item.FindControl("img_product") as HyperLink;
picture.ImageUrl = string.Format("/Picture/Product/Tumb/{0}.jpg",ID);
}
}

And then i found the problem it was e.Item.ItemIndex dam wat was i stupid the problem was that i looked at the row of the datalist and not to the row of the dataset witch can be gotten by using e.Item.DataSetIndex and now i works like a speed ass again :p
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemIndex >= 0)
{
string ID = dataSetProduct1.product[e.Item.DataSetIndex].productID.ToString();
HyperLink picture = e.Item.FindControl("img_product") as HyperLink;
picture.ImageUrl = string.Format("/Picture/Product/Tumb/{0}.jpg",ID);
}
}

Happy Netting

Url Rewriting using ASP.NET ! :D:D

Hey all,

So i needed to make myself a search engine and then i started reading

about how to build/make one i came to the conclusion that my nice litte site with view.aspx?id=10&view=True really would work because search engine's only would read the view.aspx and not the ?id=10&view=True .
This mend i had to make or get my self a url rewriter first i found some stupid ISAPI dll's that could do it for me and then i can accross this little article URL Rewriting in ASP.NET.
Men that's alot of ready here is the short version just to get it to work.

First make sure you have a project where you wane use it in :D
Now download the source code of the Url Rewriting in ASP.NET article (Click here) and install the blody thing then get you self the URLRewriter.dll and put it into the bin dir from your project.

Now for the little harder part :D!
Open your project and open the Web.Config file.
Now add the following after <configuration> and before <system.web> :
<configSections>
<
section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
<
/configSections>
Cool men now we included some config but you not done yet add the following after <system.web>:
<httpModules>
<add type="URLRewriter.ModuleRewriter, URLRewriter"
name="ModuleRewriter" />
</httpModules>
Now we included the httpmodule :D:D.
Now for the rules! this will also be done in the web.config and it will go like this just a example.
My self the problem was i had a file called view.aspx witch needed a id and view to work and displayed a product.
I needed to make the url look like this http://localhost/product/1/True/.aspx or http://localhost/product/2/False/.aspx a way to do this is add after </configSections> and before <system.web> the following code:
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/product/(\d*)/(\d*)/\.aspx</LookFor>
<SendTo>~/view.aspx?id=$1&view=$2</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
Now what this will do is display the page view.aspx?id=1&view=False if someones enters http://localhost/product/1/False/.aspx Good aint it you can also make a easyer rule or more then one let make one more if a user go's to http://localhost/product/ we want to display view.aspx?id=-1 one problem here http://localhost/product/ dus not make a .aspx this means that we will have to make the dir product and put a default.aspx file in it. After that you can add a other rull by adding the following between <Rules> and </Rules>:
<RewriterRule>
<
LookFor>~/Product/default\.aspx</LookFor>
<SendTo>~/view.aspx?cat=-1</SendTo>
</RewriterRule>
Now the http://localhost/product/ also works :D.

Any that's all you have to do it's really easy :D:D Hope someone can use this have fun all :D:D

Happy .netting

Sending Mail using c#

Hi all,

So yet again i'm bizzy with the project and i was trying to send some mail witch is very easy just do the following:

//Make the Mail Message and put some info in it
System.Web.Mail.MailMessage MMessage =
new System.Web.Mail.MailMessage();
MMessage.To = warstar-web@gmx.net;
MMessage.From = noreply@kapperkapper.nl;
MMessage.Body = String.Format("Key: {0}",status);
MMessage.Subject = "Registratie";
//Set the Mail server and send the message
System.Web.Mail.SmtpMail.SmtpServer = "mail.home.nl";
System.Web.Mail.SmtpMail.Send(MMessage);

It's very easy and works :) i'm sure that you must set the SmtpServer but i did because i don't have a working one running localhost.

Can't find a job!!! NEED A JOB!! Cry for HELP

Hey everyone,

Looking for a job is great (NOT) but finding one is even harder. I’m looking for a job in ICT because I have a diploma in that area (MBO ICT niv. 3) but yeah who needs a 17 year old boy/guy/dude to work in his/her company? It seems no one :(

So then I gave up on the ICT companies and want(ed) a job in a market but even there, there is no room for 17 year old guy :(.

SO HERE is my CRY for help!!!!!!

I live in Groningen (Netherlands) and I’m looking for a job in ICT (part-time) but a job in a market would also be great or in a café or anything. I’m 17 years old and just got my diploma “Medewerker Beheer ICT” I finished top of my class. My interest are mainly Programming and girls but the last one is really going bad lately but that’s a second something. I don’t have a lot of working experience only 6 mounds in Rotterdam but that was for my school I did learn a lot there and a paper round.
Any way if you have any interest of getting me into you business or company you can find my C.V. here: http://members.home.nl/warnar/CV.doc (don’t get pissed at me because it is in Dutch)

Anyway I hope someone can help me else I not trying would be worse.

Thanks already,
Good luck dotnetting