Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <stdlib.h>
- #include <string.h>
- bool ShowFile(char * FileName, char * Name)
- {
- FILE* file;
- if (fopen_s(&file, FileName, "rt") != 0) { return false; }
- while (!feof(file))
- {
- char AttName[100];
- int a = sscanf_s("Content-Disposition: attachment; filename=\"%[^\"]\"", AttName, _countof(AttName));
- Name = AttName;
- }
- fclose(file);
- return true;
- }
- int main(int argc, char* argv[])
- {
- char FileName[100];
- if (argc == 2) strcpy_s(FileName, _countof(FileName), argv[1]);
- else {
- printf("Source file name: "); gets_s(FileName, _countof(FileName));
- }
- char Name[100];
- ShowFile(FileName, Name);
- printf("%s \n", Name);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement