- صفحه اصلي قالب گراف
- انجمن
- آپلود سنتر
- تبليغات
- ورود
- عضويت
- خوراک
- نقشه
- تماس با ما
- ارسال پيام به مدير در انجمن ghalebgraph@gmail.com\09394943902
واقعا لعنت بر کسی که به آدم یه پروژه دانشجویی سفارش میده بعد میزنه زیرش
اینم حکایت 4 ساعت برنامه نویسی بنده
حالا میگذارم 2 نفر که معلمشون بهشون این تکلیف رو دادن کپی کنن بهش بدم
180 خط از صبح کد نوشتم آخرش طرف میگه نه خودم نوشتمش:|
ای خدا!
خودت روزی رو میرسونی..
خودت هم میگیری
پروژه دانشجویی چیزی خواستید با مبلغ خیلی کم مینویسم..
اینم از کد:
قابلیت: سیو کردن اطلاعات در پوشه ی barnamema و به اسم هر کسی یه فایل درست میکنه
تمامی مشخصات در هر فایل هر شخص ذخیره میشه
قسمت لیست کردن فایل ها
قسمت سرچ ...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
//این برنامه توسط اقبال شیراسب نوشته شده است:دی!!!
class salams
{
public static void Search(DirectoryInfo folder, string Keyword)
{
if (!folder.Exists)
{
Console.WriteLine("folder \"{0}\" not found!", folder.FullName);
return;
}
try
{
FileInfo[] files = folder.GetFiles();
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("files in {0}:", folder.Name);
Console.ForegroundColor = ConsoleColor.Gray;
for (int i = 0; i <= files.GetUpperBound(0); i++)
{
//files.Name.Contains(Keyword)
//files.Name.EndsWith(Keyword)
if (files.Name.StartsWith(Keyword))
{
Console.WriteLine(files.Name);
}
}
}
catch (Exception)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("can not access \"{0}\" contents!", folder.FullName);
Console.ForegroundColor = ConsoleColor.Gray;
}
//Console.WriteLine("press any key to continue...");
//Console.ReadKey();
try
{
DirectoryInfo[] directories = folder.GetDirectories();
for (int i = 0; i <= directories.GetUpperBound(0); i++)
{
Search(directories, Keyword);
}
}
catch (Exception)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("can not access \"{0}\" contents!", folder.FullName);
Console.ForegroundColor = ConsoleColor.Gray;
}
}
}
namespace taklif
{
class Program
{
static void Main(string[] args)
{
string a="yes";
int dd = 1;
//قسمت آدرس .شروع
string e = @"C:\Users\Eghbal\Music\barnamema";
//قسمت آدرس پایان
while (a != "no") {
Console.Clear();
Console.WriteLine("karbar {0} ", dd);
Console.Write("nam : ");
string k = Console.ReadLine();
string s = string.Format(@"{0}\{1}",e,k);
FileStream b=File.Create(s);
StreamWriter sw = new StreamWriter(b);
sw.WriteLine("{0} {1}", "nam :", k);
Console.Write("nam khanevadegi: ");
sw.WriteLine("{0} {1}", "nam khanevadegi:", Console.ReadLine());
Console.Write("email: ");
sw.WriteLine("{0} {1}", "email:", Console.ReadLine());
Console.Write("shomare telephone: ");
sw.WriteLine("{0} {1}", "shomare telephone:", Console.ReadLine());
sw.Flush();
sw.Close();
b.Close();
dd++;
Console.WriteLine("Mikhahi Edame Dahi?? ");
a = Console.ReadLine();
}
//قسمت لیست کردن فایل ها.شروع
Console.WriteLine("Mikhahi List File Haro Behet Neshon Bedam!? enter yes OR no");
if (Console.ReadLine() == "yes") {
string path = e;
DirectoryInfo d = new DirectoryInfo(path);
FileInfo[] files;
files = d.GetFiles();
Console.WriteLine("files in {0} :", d.Name);
for (int i = 0; i <= files.GetUpperBound(0); i++)
{
Console.WriteLine(files.Name);
}
}
// قسمت لیست کردن فایل ها.پایان
//قسمت سرچ کردن.شروع
Console.WriteLine("Mikhay chizi Search Koni!? ");
if (Console.ReadLine() == "yes")
{
string path = e;
Console.Write("kalame mored nazar: ");
string key = Console.ReadLine();
salams.Search(new System.IO.DirectoryInfo(path), key);
}
//قسمت سرچ کردن.پایان
}
}
}
![]() تشکر شده: |
1 کاربر از eghbal به خاطر اين مطلب مفيد تشکر کرده اند:
|