Jump to content
Xtreme .Net Talk

laptop_01

Members
  • Posts

    14
  • Joined

  • Last visited

laptop_01's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I typically use it when I want to build a long, long string that will eventually ends up in a file. Instead of writing to the file line by line, I create a stringBuilder, stuff it with my lines, and then write once.
  2. Hi I have a vb application that passes a file name (a string that defines the full path for a file) to a C# DLL. I verified that the string is being passed fine. Problem is that as soon as I try to do this: FileInfo fiFile = new FileInfo(inFile); I get this exception: C# Exception: Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed. C# Exception: at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, PermissionToken permToken) at System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, Int32 unrestrictedOverride) at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) at System.Security.CodeAccessPermission.Demand() at System.IO.FileInfo..ctor(String fileName) at CedarToXML.CedarXmlMain.ConvertFile(String inFile, String outFile, String styleSheetName, String[]& response) in l:\c#projects\cedartoxml\cedarxmlmain.cs:line 73 C# Exception: C# Exception: Thrown ByVoid CheckHelper(System.Security.PermissionSet, System.Security.PermissionSet, System.Security.CodeAccessPermission, System.Security.PermissionToken) I tried adding this int inFilePathMarker = inFile.LastIndexOf('\\'); string inFilePath = inFile.Substring(0,inFilePathMarker - 2); FileIOPermission filePerm = new FileIOPermission(FileIOPermissionAccess.Read, inFilePath); FileInfo fiFile = new FileInfo(inFile); But this still did me no good. I am using the VS IDE to compile and link the DLL and I can see that the assembly was registered. I need the dll to be used by the general public. I am hoping that I won't have to hard code the inFile in my dll :-\ :-\
  3. Hi; I have this XML structure <DS Name="aName1" File="afile" > <Value D1="1" > 7384.20 </Value> <Value D1="2" > 4844.90 </Value> <Value D1="3" > 5346.30 </Value> </DS> <DS Name="aName2" File="afile" > <Value D1="1" > 7384.20 </Value> <Value D1="2" > 4844.90 </Value> <Value D1="3" > 5346.30 </Value> <Value D1="3" > 5346.30 </Value> </DS> .. ... ...and so on I need to write an XSL match pattern such that I can always grab the last value in a particular DS element. I am having trouble figure it out. Any idea? please not the number of Value elements under each DS element is not fixed. Any idea how to do this? Thanks
  4. I am converting a legacy binary DB to XML. The DB is mostly used to store numeric arrays. Using array Temperature (x,y,z) as an example: Temperature(1,1,1) = 99.4 Temperature(1,1,2) = 100.4 Temperature(1,1,3) = 200.4 ...... and so forth I am wondering what is the best way to model this? I am currently using this XML Tag plus XSLT to format the data: <DS Name="NTCBDS" > <Value D1="1" D2="1" D3="1"> 99.4 </Value> <Value D1="1" D2="1" D3="2"> 100.2 </Value> <Value D1="1" D2="1" D3="3"> 200.1 </Value> <Value D1="1" D2="2" D3="1"> 190.3 </Value> ........ ans so forth </DS> Sometimes, I will need to query the data based on D1, or D2, or D3. For example, I may ask for all data values where D3=5 (ie, select all values where D3=5 (fixed), D1 goes from 1 to MAX and D2 goes from 1 to MAX). Question: Is the above model good or fit for such search using XSL. If yes, could you give a sample XSL to do the scenario I mentioned above. I don't seem to be able to get it right. OR should I be using: <DS Name="NTCBDS" > <Value> <D1>"1"</D1> <D2>"1"</D2> <D3>"1"</D3> 99.4 </Value> <Value> <D1>"1"</D1> <D2>"1"</D2> <D3>"2"</D3> 100.2 </Value> <Value> <D1>"1"</D1> <D2>"1"</D2> <D3>"3"</D3> 200.1 </Value> </DS> With the assumption that since D1,D2 and D3 are now elements, I may have more template power ... I am semi new to XSLT. Thanks
  5. cyclonebri, Thanks a lot. I appreciate your feed back.
  6. cyclonebri, Thanks for the reply: <root> <Array Name="myStrings" Type="String"> <Value Position="0" sValue="Foo"/> <Value Position="1" sValue="Bar"/> </Array> <Array Name="myArray" Type="Integer"> <Value Position="0" iValue="37"/> <Value Position="1" iValue="65"/> </Array> </root> Is that something like what you are looking for? Or are you looking for the actual code to do this? Can you extrpolate this to 2D array, a 2 by 3 like this? MyArray(1,1) = 14 MyArray(1,2) = 25 MyArray(1,3) = 35 MyArray(2,1) = 13 MyArray(2,2) = 46 MyArray(2,3) = 44 I would appreciate a tip on how to transform it to a table.
  7. Thanks for the reply. If you happen to know the title of a good book, please post the name. There is a book for Riley (not sure what the title is ... something XSLT something) which I will probably end up buying. This array issue is a pain. I can create a bunch of tags but I can't believe there is no standard or guidance ... at least I have not seen one.
  8. Hi; I got a string like this X:\program file\myfolder1\myFolder2\myfile.dat I need to extract myfile.dat out of this using C#. In VB, there is a nice instrRev method that allowed me to march backward from end of string. Is there something similar in C# Thansk
  9. Hi; I need to convert data stored in flat binary file (legacy database) to XML tags. The data are typically arrays of integers, float, logical ... and so forth. I have read few XML books but none seems to touch the issue of presenting Array data in XML tags. I need to maintain awarness of the array name, indexes and values for each index. Any one got an idea on how to do this or knows a site where I can check it out? Thansk
  10. Hi I have a c# console application. I pass an argumant list to this application at run time and do actions based on the arguments being passed. I need to be able to debug the whole thing. In old versions of VS, I used to be able to execute console application in debug mode and step through each line inside the IDE. Any clue how to do this in VS7.0? Thanks
  11. Hi I am trying to create a vb .NET windows application where I can also have a console window displayed in addition to the form. The idea is that if I type app1.exe then application will start up as a window application only. But if I type app1.exe /b then the application wiil start up a window application but I will als have a DOS console window up such that I can send commands from it to the form. Anyone knows how to: a - How to start a dos window from a windows application (I don't have a console application) b- How to change focus between the form and the DOS window. c- How to send commands back and forth. Thanks
  12. Thanks; I looked where you pointed me and got this part working. Thanks very much
  13. Folks; My VB Net Application is trying to retrieve an int32 array from a C++ dll but for some reason, I only get bac the first element of the array !! This is my call to the dll (using a call to encapsulate the UI call) clsCallDLL.dll_call1(intX, strY, intZ, intArray(0)) where intArray is an int32 array of 2 elements The declaration is as follows: Imports System.Runtime.InteropServices Public Class clsCallDLL Declare Sub dll_call1 Lib "MY.DLL" _ (ByRef x As Int32, ByVal y As String, ByVal z As Int32, _ ByRef myArray As Int32) End Class Problem is that I am only retrieving intArray(0) back. intArray(1) is not coming back. I pre-set it to -99 before the call and it stays -99 after the call. What can I do to get the whole array back and not just the first element. Thanks
×
×
  • Create New...