Click here to Skip to main content
       

C#

 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinprotectorPete O'Hanlon26-Feb-13 23:46 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pinmembershoab.shah27-Feb-13 0:12 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinprotectorPete O'Hanlon27-Feb-13 0:15 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pinmembershoab.shah27-Feb-13 0:18 
Here is a part of code
 
 string FAXFilePrefix = Helper.Helper.GetConfigValue("FAXFilePrefix");
                string domainName = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName;
                string location = GetLocalStoragePath() + FAXFilePrefix + requestViewModel.encounter.ServiceEncounterID + "_" + uniqueId.ToString() + ".docx"; // Backup (archive/todaysdate folder)

                MvcApplication.TraceSource.TraceEvent(TraceEventType.Information, 100, "Before Accessing UNC path ");
 
                using (Carena.PCHA.CoreServices.UncPath.UNCAccessWithCredentials unc = new Carena.PCHA.CoreServices.UncPath.UNCAccessWithCredentials())
                {
                    if (unc.NetUseWithCredentials(Path, userName, domainName, Password))
                    {
                        MvcApplication.TraceSource.TraceEvent(TraceEventType.Information, 100, "Before docx.SaveAs ");
 
                        MvcApplication.TraceSource.TraceEvent(TraceEventType.Information, 100, "Location - "+location);
                        try
                        {
                            docx.SaveAs(location);
                        }
                        catch (Exception ex)
                        {
                            loggerl.LogException(ex);
                        }
                        MvcApplication.TraceSource.TraceEvent(TraceEventType.Information, 100, "After docx.SaveAs ");
                    }
 

It throws exception at docx.SaveAs(location); line
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinprotectorPete O'Hanlon27-Feb-13 0:32 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pinmembershoab.shah27-Feb-13 1:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinmvpRichard MacCutchan27-Feb-13 3:46 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinmvpDave Kreskowiak27-Feb-13 1:07 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times Pinmembershoab.shah27-Feb-13 1:10 
GeneralRe: [DllImport("NetApi32.dll"... throws exception for first few times PinmvpDave Kreskowiak27-Feb-13 1:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 16 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid