AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 11.01.2012, 14:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
palleagermark: Sample file import with StreamReader
Источник: http://palleagermark.blogspot.com/20...eamreader.html
==============

Here is one example of how you can import files with .NET's StreamReader:
X++:
static void ImportWithStreamReader(Args _args)
{
    Filename                filename = @'C:\Temp\importme.txt';           
    System.IO.StreamReader  reader;
    System.String           line;
    InteropPermission       interopPermission;
   
    interopPermission = new InteropPermission(InteropKind::ClrInterop);
    interopPermission.assert();

    reader = new System.IO.StreamReader(filename, 

                                       System.Text.Encoding::get_UTF8());

    line = reader.ReadLine();

    while (!System.String::IsNullOrEmpty(line))
    {
        // Do something with line

        line = reader.ReadLine();
    }

    reader.Close();
    reader.Dispose();
}
If you can work with the file as on big chunk of text you can get away with just reading once, using the ReadToEnd method.

Read more about StreamReader on MSDN.


Источник: http://palleagermark.blogspot.com/20...eamreader.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.

Последний раз редактировалось Poleax; 11.01.2012 в 17:14.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Microsoft Dynamics CRM Team Blog: Create Sample Data for your Solution Blog bot Dynamics CRM: Blogs 0 01.12.2011 05:14
Trace Parser. Error: Incorrect or missing MOF file, import is not available. Poleax DAX: Администрирование 6 13.05.2011 10:43
Microsoft Dynamics CRM Team Blog: Creating Custom Sample Data for CRM 2011 - Advanced Blog bot Dynamics CRM: Blogs 0 30.04.2011 01:13
Microsoft Dynamics CRM Team Blog: Creating Custom Sample Data for Microsoft Dynamics CRM 2011 Blog bot Dynamics CRM: Blogs 0 07.01.2011 03:15
Microsoft Dynamics CRM Team Blog: Importing two or more entities from a Single File Blog bot Dynamics CRM: Blogs 0 09.11.2010 19:05
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 17:59.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.