How to read/write local file in lync silverlight application?

I tried doing that by various method but an exception pop-ups. My lync silverlight application works fine in browser or out of browser (with elevated permissions) but when I try to do so in lync's window extension (CWE) is throws an exception saying "File
operation not permitted. Access to path '<some path>' is denied". Please help!
private void button1_Click(object sender, RoutedEventArgs e)
try
if (!string.IsNullOrEmpty(textBox1.Text))
string path = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "abc.txt");
StreamWriter writer = File.CreateText(path);
writer.Write(textBox1.Text);
writer.Close();
catch (Exception ee)
MessageBox.Show(ee.Data + "\n\n" + ee.Message);

Hi,
You might post the issue on Lync MSDN forum and more developing expert will help you with Lync SDK. Thank you for your understanding.
http://social.msdn.microsoft.com/Forums/en-US/communicatorsdk/threads
Best Regards,
Eason Huang
Eason Huang
TechNet Community Support

Similar Messages

  • How to access the local files (Excelsheet) in bsp application

    Hi sdn,
    I created a bsp application my requirement is if i click the link it should display the excelsheet and if i perform any updations those updations will be modified int that excel sheet so can any one plz help me out in solving this issue.

    Hi,
    I think you shouldn't try to modifiy local files from a server application for security reasons.
    But, let's say you have your reasons.
    In your BSP, you have a link that points to an MS Excel file. Clicking this link will open the file in MS Excel and users will be able to modify and register it (and save the file in another path/name...).
    Another solution would be: create a table form (like ALV?) from the Excel file and save any modifications of the table form into the Excel file. Maybe HTMLB can supports such approach but I don't know HTMLB. I only use HTML and ABAP.
    All I said here is just overview of potential solutions. I'm not sure I exactly understood your need. Perhaps other Experts would have better answer for you.
    But I hope this will help you.
    Good luck!
    Thomas.

  • How to read a local file using as3 in a flash object in HTML? [urgent]

    My web site contains a flash object.
    I want to use as3 to read some local .txt file
    by getting the user directory of the file.
    i know AIR can support this by sth like:
    File.desktopDirectory.resolvePath
    but when i open a AIR file for this, it seems
    the action cant be run when i embed it in html.
    And i tried to use the above function in a normal
    flash file in the action script.
    But it cant recognize the File. class..
    How can it be done ?
    It's reli urgent,
    please help...
    Thanks !

    a web based flash app can't detect user directories.  you can use the filereference class'es browse method to let the user locate a file in any directory the user wants.  flash can then retrieve the file's name and type.  but, as mentioned before,  flash can't determine the file's directory.

  • How to read/write .CSV file into CLOB column in a table of Oracle 10g

    I have a requirement which is nothing but a table has two column
    create table emp_data (empid number, report clob)
    Here REPORT column is CLOB data type which used to load the data from the .csv file.
    The requirement here is
    1) How to load data from .CSV file into CLOB column along with empid using DBMS_lob utility
    2) How to read report columns which should return all the columns present in the .CSV file (dynamically because every csv file may have different number of columns) along with the primariy key empid).
    eg: empid report_field1 report_field2
    1 x y
    Any help would be appreciated.

    If I understand you right, you want each row in your table to contain an emp_id and the complete text of a multi-record .csv file.
    It's not clear how you relate emp_id to the appropriate file to be read. Is the emp_id stored in the csv file?
    To read the file, you can use functions from [UTL_FILE|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#BABGGEDF] (as long as the file is in a directory accessible to the Oracle server):
    declare
        lt_report_clob CLOB;
        l_max_line_length integer := 1024;   -- set as high as the longest line in your file
        l_infile UTL_FILE.file_type;
        l_buffer varchar2(1024);
        l_emp_id report_table.emp_id%type := 123; -- not clear where emp_id comes from
        l_filename varchar2(200) := 'my_file_name.csv';   -- get this from somewhere
    begin
       -- open the file; we assume an Oracle directory has already been created
        l_infile := utl_file.fopen('CSV_DIRECTORY', l_filename, 'r', l_max_line_length);
        -- initialise the empty clob
        dbms_lob.createtemporary(lt_report_clob, TRUE, DBMS_LOB.session);
        loop
          begin
             utl_file.get_line(l_infile, l_buffer);
             dbms_lob.append(lt_report_clob, l_buffer);
          exception
             when no_data_found then
                 exit;
          end;
        end loop;
        insert into report_table (emp_id, report)
        values (l_emp_id, lt_report_clob);
        -- free the temporary lob
        dbms_lob.freetemporary(lt_report_clob);
       -- close the file
       UTL_FILE.fclose(l_infile);
    end;This simple line-by-line approach is easy to understand, and gives you an opportunity (if you want) to take each line in the file and transform it (for example, you could transform it into a nested table, or into XML). However it can be rather slow if there are many records in the csv file - the lob_append operation is not particularly efficient. I was able to improve the efficiency by caching the lines in a VARCHAR2 up to a maximum cache size, and only then appending to the LOB - see [three posts on my blog|http://preferisco.blogspot.com/search/label/lob].
    There is at least one other possibility:
    - you could use [DBMS_LOB.loadclobfromfile|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i998978]. I've not tried this before myself, but I think the procedure is described [here in the 9i docs|http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96591/adl12bfl.htm#879711]. This is likely to be faster than UTL_FILE (because it is all happening in the underlying DBMS_LOB package, possibly in a native way).
    That's all for now. I haven't yet answered your question on how to report data back out of the CLOB. I would like to know how you associate employees with files; what happens if there is > 1 file per employee, etc.
    HTH
    Regards Nigel
    Edited by: nthomas on Mar 2, 2009 11:22 AM - don't forget to fclose the file...

  • How to read a local file from Applet Code

    Hi
    I am developing a application and i want to access a local file from the applet
    So pls help me in coding for this

    You can't do that, at least not with an unsigned applet.
    Sign your applet and it should work just like normal file access.

  • How to read a local file from Forms10g using PJC/Bean

    I'm trying to read a file on the client machine using a Bean.
    The code in the Bean is:
    File fp = new File(mFileName);
    printToConsole( "AFTER creating a File object " );
    if (fp.exists())
    I get the message after creating File object. But at the next statement - fp.exists() - the Forms session terminates giving a FRM-92100 - Your connection to the server was interrupted.
    Any ideas?
    Thanks in advance for your help.
    Amit

    Frank, Thank you for your response on signing the jar. That was exactly what I was missing. After signing the jar, I am able to do client level operations.
    Grant, Thank you for asking about WebUtil. To give you a background as to what we are trying to do - to integrate our Forms 10g application with another software - in this case a client-server app. We want to send a message from this app. to our Forms10g app.(a pre-defined Form in the app.) which would initiate certain Forms navigation based on the message. In essence, Forms needs to be "listening" to this app. (in a non-blocking mode, the Forms app. should not be "locked-out" while listening for a message)
    The only way I could think of was to write a Bean (modified version of Frank's Dispatch Event sample on his blog) which would spawn a thread and listen for a message from the other app. For our prototype, I started off with watching for a file on the client machine. The final goal is to listen for a message on MQ. This will facilitate us to integrate our Forms10g app. with any other app.
    Regarding WebUtil, I did not find a way to do the listening/polling in a non-blocking way. Maybe I must have missed the obvious - Frank can very well attest to that.
    Any feedback is most welcome.
    Thanks.
    Amit

  • How can read & write .ncd files?

    I need to create / modify a .ncd file (used in Max 3.0.2) for can channel configuration. How can I do that in C or VB?

    Giuliano,
    if you try to open the .ncd file with Notepad it states it is an XML 1.0 file. Actually, if you open it up with MS Internet Explorer you should be able to see exactly the same structure you see in MAX.
    So, if you want to modify and/or create the .ncd file externally you can use a text editor or an XML parser to write your .ncd files and then load the messages from MAX.
    Greetings
    AlessioD
    National Instruments

  • How to read\write text file into oracle database.

    Hello,
    I am having text file called getInfo in c:\temp folder. I would like to populate data from text file to data base. How to proceed. Could anybody help me out.
    Thanks,
    Shailu

    Here is a web page with easy to follow instructions regarding external files: http://www.adp-gmbh.ch/ora/misc/ext_table.html.
    Now I understand what all the excitement is over external tables.
    "External tables can read flat files (that follow some rules) as though they were ordinary (although read-only) Oracle tables. Therefore, it is convenient to use external tables to load flat files into the DB." -from the above link.

  • How to read/write text file to db2 by using java code

    Hai
    I created the table to insert a clob data as follows
    db2 => create table ctest(datas clob(65536))
    DB20000I The SQL command completed successfully.
    db2 => describe table ctest
    Column Type Type
    name schema name Length Scale Nulls
    DATAS SYSIBM CLOB 65536 0 Yes
    1 record(s) selected.
    I tried the following java code to insert a clob data.
    public static synchronized Connection getConnection() throws Exception {
    Connection m_connectionDatabase = null;
    try {
    Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
    // Get the connection to the database.
    m_connectionDatabase = DriverManager.getConnection(
    "jdbc b2 ps","","");
    }catch (Exception e) {
    throw new Exception("Failed to connect to the database. ", e);
    return m_connectionDatabase;
    public static void main(String a[]) {
    File file = new File("d:\\a.txt");
    InputStream fis = new FileInputStream(file);
    Connection con = getConnection();
    PreparedStatement pstmt = con.prepareStatement("insert into ctest values(?)");
    //try 1
    pstmt.setAsciiStream(1,fis,(int)file.length());
    // try 2
    pstmt.setCharacterStream(1,fis,(int)(file.length()));
    // try 3
    pstmt.setBinaryStream(1,fis,(int)(file.length()));
    // try 4
    byte[] b = new byte[fis.available()];
    fis.read(b);
    pstmt.setBytes(1, b);
    // try 5
    byte[] b = new byte[fis.available()];
    fis.read(b);
    pstmt.setString(1, new String(b));
    pstmt.executeUpdate();
    pstmt.close();
    fis.close();
    Result:
    If the file size is less than 32kb, it inserted successfully.
    but if more than 32kb, it throws follwing exception
    COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0352N An unsupported SQLTYPE was encountered in position "1" of the input list (SQLDA). SQLSTATE=56084
    at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source)
    at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source)
    at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(Unknown Source)
    at COM.ibm.db2.jdbc.app.DB2PreparedStatement.loadParameters(Unknown Source)
    at COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute2(Unknown Source)
    at COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeUpdate(Unknown Source)
    Can any body please help out to insert clob value.
    Thanks in advance
    V.Shan

    Normally I would be happy to help you, but after several years of trying to help here, I've decided not to contribute anymore because of the piss-poor way in which this site is being administered.
    Others are still helping, but more may leave if things don't improve. May I recommend devshed or javaranch?
    http://www.devshed.com/
    http://www.javaranch.com/
    If you would like to complain to the admins of this forum, either click the "Report Abuse" link or the "Feedback" link.
    -- foofoo (shamelessly stolen the text from jverd).

  • How to read multiple dat files.

    Hello Everyone!
    I am working on a project that requires one file that creates a JFrame with a current file title, JTextFields that accesses two .dat files and a JButton.
    The user clicks a JButton to cycle through the first sequential .dat file. When the end of the first file is reached the file is closed, the JFrame title is changed to the second file title as the user continues to click the JButton to continue on viewing the second file?s records, until the second reaches the end of file.
    The project requires using Try-Catches to catch the EOF exceptions and IOExceptions and Thread or Runnable.
    I have been able to get one file to read and display its records; however, researching back through my text on how to read/write to files I haven?t been able to determine how to get to the end of the file and proceed to the next file without triggering the EOFException. I have even tried multiple Try-Catches (one for each file within the actionPerformed method) and that ends up ignoring the first file records and only displays the second files records.
    This is a school project and we have only covered just the bare basics of Java over the last two months. So, any hints that anyone can provide can only be of what type of procedure will be needed or what procedure won?t help to complete the task, without giving away the solution.
    I have spent approximately 40 hours of study time on this project and believe that I have definitely run into a major snag.
    The following is the code I have so far:
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class StudentRead extends JFrame implements ActionListener
       private JLabel gradStudentList = new JLabel("GRADUATE Student List");
       private JLabel undergradStudentList = new JLabel("UNDERGRADUATE Student List"); 
       private Font bigFont = new Font("Helvetica", Font.ITALIC, 24);
       private JLabel userprompt = new JLabel("View the students");
       private JTextField idNumText = new JTextField(4); 
       private JTextField lastNameText = new JTextField(15);
       private JTextField firstNameText = new JTextField(15);
       private JButton viewRecordButton = new JButton("View Record");
       private JLabel idNumberLabel = new JLabel("ID Number"); 
       private JLabel lastNameLabel = new JLabel("Last name"); 
       private JLabel firstNameLabel = new JLabel("First name");
       private Container con = getContentPane();
       DataInputStream gradStudentInStream;
       DataInputStream undergradStudentInStream;
       public StudentRead()
          super("Read Student Records");
          try
             gradStudentInStream = new DataInputStream(new FileInputStream("GradStudents.dat"));
             undergradStudentInStream = new DataInputStream(new FileInputStream("UndergradStudents.dat"));
          catch(IOException e)
             System.err.println("File not opened");
             System.exit(1);
          setSize(325, 200);
          con.setLayout(new FlowLayout());
          gradStudentList.setFont(bigFont);
          con.add(gradStudentList);
          con.add(userprompt);
          con.add(idNumberLabel);
          con.add(idNumText);
          con.add(lastNameLabel);
          con.add(lastNameText);
          con.add(firstNameLabel);
          con.add(firstNameText);
          con.add(viewRecordButton);
          viewRecordButton.addActionListener(this);
          setVisible(true);
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       public void actionPerformed(ActionEvent e1)
          String lastName, firstName;     
          int IdNum;
          try
             IdNum = gradStudentInStream.readInt();      
             lastName = gradStudentInStream.readUTF();
             firstName = gradStudentInStream.readUTF();
             idNumText.setText(String.valueOf(IdNum));
             lastNameText.setText(lastName);
             firstNameText.setText(firstName);
          catch(EOFException e2)
             closeFile();
             System.exit(0);
          catch(IOException e3)
             System.err.println("Error reading file");
             System.out.println("out");      
             System.exit(1);
       public void closeFile()
          try
             gradStudentInStream.close();
             System.exit(0);
          catch(IOException e)
             System.err.println("Error closing file");
             System.exit(1);
       public static void main(String[] args)
          StudentRead rsr = new StudentRead();
    }

    deepak_1your.com wrote:
    hi,
    If you want to read a file guarding yourself agianst exceptions....
    check this article.... the code presented in this article might suit your needs...
    [http://1your.com/fusion/infusions/articles/readarticle.php?article_id=17|http://1your.com/fusion/infusions/articles/readarticle.php?article_id=17]
    And how does that help with a DataInputStream?

  • How to read an excel file in webdynpro application

    Hello Experts,
    Can someone please tell me how to read an excel file in a webdynpro application?
    There is a tutorial for how to write contect into an excel, but i want to read the excel.
    Can someone help please !!
    Thanks and Kind regards,
    G.Singh.

    Hello Experts,
    I have done all the given above.
    I want to read a excel file from KM. My code is as below
    ResourceContext resourceContext = buildResourceContext();
    IResourceFactory resourceFactory = ResourceFactory.getInstance();
    RID pathRID = RID.getRID("/documents/ExcelReport.xls");     
    IResource resource =     resourceFactory.getResource(pathRID, resourceContext);
    Workbook wb = Workbook.getWorkbook(resource.getURI().getPath());
    Sheet sh = wb.getSheet(0);
    int columns = sh.getColumns();
    int rows = sh.getRows();
    wdComponentAPI.getMessageManager().reportSuccess(" Rows: " + rows);
    wdComponentAPI.getMessageManager().reportSuccess(" Columns: " + columns);
    This does not give me the excel file form the KM
    Can you please just what i can do at this point?
    Kind Regards,
    G Singh.

  • How to read write excel through BPEL

    hi,
    how to read write excel file from BPEL process; is there any adapter available for excel specially.

    Hi,
    there is no adapter provided from Oracle.
    I think you have to write a .NET webservice, which accomplished this for you....

  • How to read write file in HTML5 extension

    Hi,
    I think it could be very generic question since moving from Flex to HTML5 extension is loosing ability to read write a file in local file system.
    I'm trying to write a log file within extension space but It throws error as 'TypeError: Illegal constructor'
    new File(csInterface.getSystemPath(SystemPath.EXTENSION)+"/log/Log_"+.getCurrentDateString+".txt");
    does someone have solve for this.
    Thanks in advance
    MM

    Yeah, It could be a reason for nested error but I got the error right before executing "getCurrentDateString". But I kind of figured it out as Javascript looses ability to read write file in user file system except Crome browser, you can read more here. However Adobe has added fs API within CEP which allows user to read and write file in user system.
    Here is some peace of code on how to do it, complete API reference check here :
    var result = window.cep.fs.writeFile(logFilepath, "Your data goes here");
      if(result.err != 0)
      throw new Error("Result object has error");
    However still this does not provide any method to append the content in existing file as a result if you wanted to write kind of log file, every time you need to first read the file and then concatenate your content to file data then write data again to new file. sound hefty to append content?
    I'm hoping if any Adobe staff has any comment on this.
    Thanks
    MM

  • How can read/write FORMSWEB.CFG & DEFAULT.ENV file entries programatically?

    Environment: Forms 9i (Web)
    As : Oracle 9i As
    How can read/write FORMSWEB.CFG & DEFAULT.ENV file entries programatically?

    I guess you cannot. There is an enhancement request to get the name of the config-section as a GET_APPLICATION_PROPERTY.
    What you could do is add extra parameter(s) to your form and pass the necessary formsweb.cfg parameters in this form parameter. See Get formsweb.cfg section name in Forms for more info and an example.

  • How To read/write file on remote server in java

    Hi All,
    How To read/write file on remote server in java? I mean using URL - http://www.xyz.com can I right file to that perticular server.
    Thanks in advance

    If your server support a means of uploading files you can.
    A popular means is [http://en.wikipedia.org/wiki/WebDAV]
    However, by default web server don't allow you upload files, its usually something you need to configure or install.
    I suggest you have a look at your web servers documentation.

Maybe you are looking for