귀하의 질문은 솔루션에 대한 연구의 노력을 보여줍니다하지만 디렉토리 예에 중계 어떻게을 보여줍니다 :
string directory = "C:/#";
int count = 0;
string[] files = Directory.GetFiles(directory, "*.txt");
for(int i=0; i<files.Length; i++)
{
if(files[i].StartsWith("HelloWorld"))
{
count++;
}
}
MessageBox.Show("Num. of files: " + count);
는 테스트하지 있고 난 그냥 썼다. 작동하지 않는지 말해봐.
try
{
if (FilePath == "")
{
MessageBox.Show("Please Browse for and select a file");
}
else
{
if (activedrawing == null)
{
MessageBox.Show("No Drawing Found");
}
else
{
string fileName = "InsertImage"+ FileName + ".PNG";
string sourcePath = FilePath;
string targetPath = info.ModelPath;
string sourceFile = System.IO.Path.Combine(sourcePath);
string destFile = System.IO.Path.Combine(targetPath, fileName);
if (!System.IO.Directory.Exists(targetPath))
{
System.IO.Directory.CreateDirectory(targetPath);
}
System.IO.File.Copy(sourceFile, destFile, true);
당신이 코드 예제를 추가 할 수 있습니다 : 여기 –
현재 시도를 제공하면 더 빨리 대답 할 수 있습니다. 지금은 ... 0에서 프로그램을 작성해야하며, 기존 프로그램이있을 때 쓸모가 없습니다. [help]도 참조하십시오. –
다음 번엔 과제를 쓰는 데 시간을 낭비해서는 안되며, 그냥 링크를 붙여 두는 것이 좋습니다. – Orace