473,325 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

How to filter file by file name? (ASP.NET 1.0 , C#)

1
I'm writting a program for upload file to Web server

first I new a file folder name Report on my Web Server

and then new many sub file folder in the Report file folder

WebServer -- Report -- Adasa

-- Shopbop

-- RevolveClothing .... ( total have 42 sub folder under Report)

--------------------------------------------------------------------------------------------

the name of uploading file are many kind of format

such as 20070122Adasa80802 、2239Shopbop0aaaa、20938Adasa80291、qqqqRevolveCloth ing ... and so on

I want to filter if the file name doesn't have Adasa、Shopbop or RevelveClothing ... (42 kind of key words)

------------------------------------------------------------------------------------------

how to do it?

I'm using Asp.net 1.0 c#



thank you very much
Jul 17 '07 #1
1 2188
Plater
7,872 Expert 4TB
The string class has a .IndexOf(searchstring) function that will return a -1 if the searchstring is not found in the original string.

Example:
Expand|Select|Wrap|Line Numbers
  1. string n="Fred is fast";
  2. int a=n.IndexOf("is");//a is set to 5
  3. int b=n.IndexOf("aaaaaa");//since aaaaaa is not contained withen n, b is set to -1
  4.  
You could loop through your required strings to find a match.
Jul 17 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
1
by: Michael Shutt | last post by:
We have an existing ISAPI filter that performs authentication for all pages on our web site, including pages we are now writing for ASP.NET. The filter is pretty basic, receiving the user name and...
0
by: Anonieko Ramos | last post by:
Answer. Use IHttpHandler. thanks Ro ry for coming up with this code. It processes css file to add variables. neat idea using System; using System.IO; using System.Text; using...
10
by: Guoqi Zheng | last post by:
I know I can use http module in my asp.net project to rewrite url. However that is only true for .aspx page, there are many other static page in my application such as .htm. .asp, etc. My...
2
by: Dmitry Duginov | last post by:
I wrote HTTP module and configured it to fire with every request to my application. In IIS6 aspnet_isapi.dll mapped as Application Extension, web.config contains the following: <system.web> ...
1
by: Luurs | last post by:
Hi All, I've been using a asp-label in the HTML <headsection for quite some time in order to dynamically generate meta-keywords,-description, css and js references. Though the actual...
0
by: =?Utf-8?B?SnVzdGluIFJvYmVydHM=?= | last post by:
Hi I am developing a mobile web VB asp.net application in VS 2005. The forms are mobile web forms. I have a mobile web configuration page (web.config). In one of my forms I have a DeviceSpecific...
1
by: nth | last post by:
I wan to filter the database show out information by using the user login name. Means that when that user login by entering their names n password, if correct then it will go to the other page by...
3
by: franc sutherland | last post by:
Hello, I have a report which I filter using the me.filter command in the OnOpen event. Me.Filter = "OrderID=" & Forms!variable_form_name! Me.FilterOn = True I want to be able to open that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.