Search Results

Search found 15210 results on 609 pages for 'technical writing'.

Page 42/609 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Get File Size of Modified Image Before Writing to Disk

    - by Otaku
    I'm doing a conversion from .jpg to .png in System.Drawing and one thing that I've found is that this conversion tends to make the resulting converted .png much larger than the .jpg original. Sometimes more than 10x larger after converting to .png. Given that seems to always be the case (unless you know of a way around this), is there any way to determine the file size of that .png before it is saved to disk? For example, maybe write it to a stream first and then get that stream size? How would I go about doing this?

    Read the article

  • Test-driven Development: Writing tests for private / protected variables

    - by Chetan
    I'm learning TDD, and I have a question about private / protected variables. My question is: If a function I want to test is operating on a private variable, how should I test it? Here is the example I'm working with: I have a class called Table that contains an instance variable called internalRepresentation that is a 2D array. I want to create a function called multiplyValuesByN that multiplies all the values in the 2D array by the argument n. So I write the test for it (in Python): def test_multiplyValuesByN (self): t = Table(3, 3) # 3x3 table, filled with 0's t.set(0, 0, 4) # Set value at position (0,0) to 4 t.multiplyValuesByN(3) assertEqual(t.internalRepresentation, [[12, 0, 0], [0, 0, 0], [0, 0, 0]]) Now, if I make internalRepresentation private or protected, this test will not work. How am I supposed to write the test so it doesn't depend on internalRepresentation but still tests that it looks correct after calling multiplyValuesByN?

    Read the article

  • Writing an optimised and efficient search engine with mySQL and ColdFusion

    - by Mel
    I have a search page with the following scenarios listed below. I was told there was a better way to do it, but not how, and that I am using too many if statements, and that it's prone to causing an error through url manipulation: Search.cfm will processes a search made from a search bar present on all pages, with one search input (titleName). If search.cfm is accessed manually (through URL not through using the simple search bar on all pages) it displays an advanced search form with three inputs (titleName, genreID, platformID) or it evaluates searchResponse variable and decides what to do. If simple search query is blank, has no results, or less than 3 characters it displays an error If advanced search query is blank, has no results, or less than 3 characters it displays an error If any successful search returns results, they come back normally. The top-of-page logic is as follows: <!---SET DEFAULT VARIABLE---> <cfparam name="variables.searchResponse" default=""> <!---CHECK TO SEE IF SIMPLE SEARCH A FORM WAS SUBMITTED AND EXECUTE SEARCH IF IT WAS---> <cfif IsDefined("Form.simpleSearch") AND Len(Trim(Form.titleName)) LTE 2> <cfset variables.searchResponse = "invalidString"> <cfelseif IsDefined("Form.simpleSearch") AND Len(Trim(Form.titleName)) GTE 3> <!---EXECUTE METHOD AND GET DATA---> <cfinvoke component="myComponent" method="simpleSearch" searchString="#Form.titleName#" returnvariable="simpleSearchResult"> <cfset variables.searchResponse = "simpleSearchResult"> </cfif> <!---CHECK IF ANY RECORDS WERE FOUND---> <cfif IsDefined("variables.simpleSearchResult") AND simpleSearchResult.RecordCount IS 0> <cfset variables.searchResponse = "noResult"> </cfif> <!---CHECK IF ADVANCED SEARCH FORM WAS SUBMITTED---> <cfif IsDefined("Form.AdvancedSearch") AND Len(Trim(Form.titleName)) LTE 2> <cfset variables.searchResponse = "invalidString"> <cfelseif IsDefined("Form.advancedSearch") AND Len(Trim(Form.titleName)) GTE 2> <!---EXECUTE METHOD AND GET DATA---> <cfinvoke component="myComponent" method="advancedSearch" returnvariable="advancedSearchResult" titleName="#Form.titleName#" genreID="#Form.genreID#" platformID="#Form.platformID#"> <cfset variables.searchResponse = "advancedSearchResult"> </cfif> <!---CHECK IF ANY RECORDS WERE FOUND---> <cfif IsDefined("variables.advancedSearchResult") AND advancedSearchResult.RecordCount IS 0> <cfset variables.searchResponse = "noResult"> </cfif> I'm using the searchResponse variable to decide what the the page displays, based on the following scenarios: <!---ALWAYS DISPLAY SIMPLE SEARCH BAR AS IT'S PART OF THE HEADER---> <form name="simpleSearch" action="search.cfm" method="post"> <input type="hidden" name="simpleSearch" /> <input type="text" name="titleName" /> <input type="button" value="Search" onclick="form.submit()" /> </form> <!---IF NO SEARCH WAS SUBMITTED DISPLAY DEFAULT FORM---> <cfif searchResponse IS ""> <h1>Advanced Search</h1> <!---DISPLAY FORM---> <form name="advancedSearch" action="search.cfm" method="post"> <input type="hidden" name="advancedSearch" /> <input type="text" name="titleName" /> <input type="text" name="genreID" /> <input type="text" name="platformID" /> <input type="button" value="Search" onclick="form.submit()" /> </form> </cfif> <!---IF SEARCH IS BLANK OR LESS THAN 3 CHARACTERS DISPLAY ERROR MESSAGE---> <cfif searchResponse IS "invalidString"> <cfoutput> <h1>INVALID SEARCH</h1> </cfoutput> </cfif> <!---IF SEARCH WAS MADE BUT NO RESULTS WERE FOUND---> <cfif searchResponse IS "noResult"> <cfoutput> <h1>NO RESULT FOUND</h1> </cfoutput> </cfif> <!---IF SIMPLE SEARCH WAS MADE A RESULT WAS FOUND---> <cfif searchResponse IS "simpleSearchResult"> <cfoutput> <h1>Search Results</h1> </cfoutput> <cfoutput query="simpleSearchResult"> <!---DISPLAY QUERY DATA---> </cfoutput> </cfif> <!---IF ADVANCED SEARCH WAS MADE A RESULT WAS FOUND---> <cfif searchResponse IS "advancedSearchResult"> <cfoutput> <h1>Search Results</h1> <p>Your search for "#Form.titleName#" returned #advancedSearchResult.RecordCount# result(s).</p> </cfoutput> <cfoutput query="advancedSearchResult"> <!---DISPLAY QUERY DATA---> </cfoutput> </cfif> Is my logic a) not efficient because my if statements/is there a better way to do this? And b) Can you see any scenarios where my code can break? I've tested it but I have not been able to find any issues with it. And I have no way of measuring performance. Any thoughts and ideas would be greatly appreciated. Many thanks

    Read the article

  • Javascript: Writing a firefox extension with sockets

    - by Johnny Grass
    I need to write a firefox extension that creates a server socket (I think that's what it's called) and returns the browser's current url when a client application (running on the same computer) sends it a request. The thing is that I have no Java/Javascript background at all and I'm pressed for time so I am trying to hack something together from code samples. So far I've been mildly successful. I've been working with code from this question which is used in the open source Firefox exension PolyChrome I have the following code: var reader = { onInputStreamReady : function(input) { var input_stream = Components.classes["@mozilla.org/scriptableinputstream;1"] .createInstance(Components.interfaces.nsIScriptableInputStream); input_stream.init(input); input_stream.available(); var request = ''; while (input_stream.available()) { request = request + input_stream.read(512); } var checkString = "foo" if (request.toString() == checkString.toString()) { output_console('URL: ' + content.location.href); } else output_console("nothing"); var thread_manager = Components.classes["@mozilla.org/thread-manager;1"].getService(); input.asyncWait(reader,0,0,thread_manager.mainThread); } } var listener = { onSocketAccepted: function(serverSocket, clientSocket) { output_console("Accepted connection on "+clientSocket.host+":"+clientSocket.port); input = clientSocket.openInputStream(0, 0, 0).QueryInterface(Components.interfaces.nsIAsyncInputStream); output = clientSocket.openOutputStream(Components.interfaces.nsITransport.OPEN_BLOCKING, 0, 0); var thread_manager = Components.classes["@mozilla.org/thread-manager;1"].getService(); input.asyncWait(reader,0,0,thread_manager.mainThread); } } var serverSocket = Components.classes["@mozilla.org/network/server-socket;1"]. createInstance(Components.interfaces.nsIServerSocket); serverSocket.init(9999, true, 5); output_console("Opened socket on " + serverSocket.port); serverSocket.asyncListen(listener); I have a few questions. So far I can telnet into localhost and get a response, but my string comparison in the reader seems to fail even if I enter "foo". I don't get why. What am I missing? The sample code I'm using opens up a console window and prints output when I telnet into localhost. Ideally I would like the output to be returned as a response when the client sends a request to the server socket with a passphrase. How do I go about doing that? Is doing this a good idea? Does it create security vulnerabilities on the computer? How can I block connections to the socket from other computers? What is a good place to read about javascript sockets? My google searches have been pretty fruitless but then maybe I'm not using the right keywords.

    Read the article

  • Writing C# GUI over a C++ dll or C++ exe

    - by user97642
    Hi I have a C++ console Exe which does some progamming. Now i wanted to write a C# GUI which does some of the programming that the C++ exe does. I was thinking of few approaches, Write the C# GUI with all programming in C++ done from scratch.(I do not want to do this for the amount of rework it entails) Build a C++ dll which does the programming and have it imported in GUI app.(Now here i have a concern. How do i capture the output of the routines in c++ dll and display it in GUI? Should i return the output as string for every routine that the app calls.? Since i dont know managed c++ iam going to build an unmanaged C++ dll. )

    Read the article

  • reloading app.config after writing

    - by rubentjeuh
    Hi, When I use this to write to my app.config file: Configuration config =ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings["Wachtwoord"].Value = "Test"; config.Save(); ConfigurationManager.RefreshSection("appSettings"); I can read it again. But when i close and restart the program, the value of "Wachtwoord" has changed again to the old value. Does anybody how I could fix this? Thanks

    Read the article

  • Access is re-writing - and breaking - my query!

    - by FrustratedWithFormsDesigner
    I have a query in MS Access (2003) that makes use of a subquery. The subquery part looks like this: ...FROM (SELECT id, dt, details FROM all_recs WHERE def_cd="ABC-00123") AS q1,... And when I switch to Table View to verify the results, all is OK. Then, I wanted the result of this query to be printed on the page header for a report (the query returns a single row that is page-header stuff). I get an error because the query is suddenly re-written as: ...FROM [SELECT id, dt, details FROM all_recs WHERE def_cd="ABC-00123"; ] AS q1,... So it's Ok that the round brackets are automatically replaced by square brackets, Access feels it needs to do that, fine! But why is it adding the ; into the subquery, which causes it to fail? I suppose I could just create new query objects for these subqueries, but it seems a little silly that I should have to do that.

    Read the article

  • Writing to pointer out of bounds after malloc() not causing error

    - by marr
    Hi, when I try the code below it works fine. Am I missing something? main() { int *p; p=malloc(sizeof(int)); printf("size of p=%d\n",sizeof(p)); p[500]=999999; printf("p[0]=%d",p[500]); return 0; } I tried it with malloc(0*sizeof(int)) or anything but it works just fine. The program only crashes when I don't use malloc at all. So even if I allocate 0 memory for the array p, it still stores values properly. So why am I even bothering with malloc then?

    Read the article

  • asynchronous writing and reading of a file

    - by tazim
    hi, I have two processes. 1.) One processes is redirecting output of some unix command to a file on server side.the data is always appended to the file eg : find / > tmp.txt 2.)Another process is opening and reading the same file and storing it in a string and sending the entire string to the client Now, this things take simultaneously. I am using python. Any suggestion as in what can be possible ways to implement this scenario . Please explain with sample code . Thanks in advance . Tazim.

    Read the article

  • Need help with writing from XML to a SQL Server database (detailed)

    - by fogedi
    I'm a bit of a newbie with XML and WebServices and stuff like that. I'm working on a project using GlassFish OpenESB to schedule a process to get some information from a webservice and then store in a database. The criteria is basically that i have to use GlassFish OpenESB or EJB modules where i can expose webservices or something along those lines, AND i have to use SQL Server 2005. So far I've been able to talk to the webservice: and receive something along those lines <?xml version="1.0" encoding="UTF-8" standalone="no"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <m:entrypoint_getSettlementsOperationResponse xmlns:m="http://j2ee.netbeans.org/wsdl/BorgunTestBPEL/entrypoint_getSettlements"> <part1> <GetSettlementsByMerchantResponse xmlns="http://Borgun.Services.Gateway/2010/04/Settlement"> <GetSettlementsByMerchantResult xmlns:a="http://schemas.datacontract.org/2004/07/Borgun.Library.Common" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:msgns="http://Borgun.Services.Gateway/2010/04/Settlement" xmlns:ns0="http://j2ee.netbeans.org/wsdl/BorgunTestBPEL/entrypoint_getSettlements"> <a:CreditCardSettlement> <a:amexAmount>XXX</a:amexAmount> <a:amount>XXXX</a:amount> <a:batches> <a:CreditCardBatch> <a:batchdate>xxx</a:batchdate> <a:batchnumber>XXXX</a:batchnumber> <a:currencyCode>xxxx</a:currencyCode> <a:merchantnumber>xxxx</a:merchantnumber> <a:settlementRunNumber>xx4</a:settlementRunNumber> <a:settlementdate>2010-04-06T00:00:00</a:settlementdate> <a:slips>2</a:slips> <a:sum>xxxx</a:sum> </a:CreditCardBatch> <a:CreditCardBatch> <a:batchdate>xxx</a:batchdate> <a:batchnumber>xxxxx</a:batchnumber> <a:currencyCode>xxxx</a:currencyCode> <a:merchantnumber>xxxx</a:merchantnumber> <a:settlementRunNumber>xxxx</a:settlementRunNumber> <a:settlementdate>xxxx</a:settlementdate> <a:slips>x</a:slips> <a:sum>xxx</a:sum> </a:CreditCardBatch> </a:batches> <a:commission>xx</a:commission> <a:currencyCode>xxx</a:currencyCode> <a:deduction>-xxx</a:deduction> <a:deductionItems> <a:CrediCardSettlementDeduction> <a:amount>-xxx</a:amount> <a:code>VIÐSKF</a:code> <a:currencyCode>ISK</a:currencyCode> <a:merchantnumber>xxx</a:merchantnumber> <a:settlementrunnumber>xxx</a:settlementrunnumber> <a:text>Afsláttur v/ekorta</a:text> </a:CrediCardSettlementDeduction> <a:CrediCardSettlementDeduction> <a:amount>-335.00</a:amount> <a:code>ÁLAGKREK</a:code> <a:currencyCode>ISK</a:currencyCode> <a:merchantnumber>xxx</a:merchantnumber> <a:settlementrunnumber>xxx</a:settlementrunnumber> <a:text>xxx</a:text> </a:CrediCardSettlementDeduction> </a:deductionItems> </a:CreditCardSettlement> </GetSettlementsByMerchantResult> </GetSettlementsByMerchantResponse> </part1> </m:entrypoint_getSettlementsOperationResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> I have access to the SQL Server 2005 server which is remote and i know i can insert into it but given that now i have a one-to-many relationship i want to be able to rollback if something fails. So in short how can I insert from this XML into the DB preferably without manually walking through the XML tree? I'm pretty sure I'm supposed to be able to use Entity and Session Beans or maybe JAXB bindings but I'm simply not being successful. One of the reasons might have something to do with the fact that the soap response contains an array of CreditCardSettlements and each of which contains an array of Batches and DeductionItems It would be best if someone can help me do this via a BPEL in GlassFish OpenESB but any hint at a java solution is much appreciated.

    Read the article

  • Array of Arrays - writing to File problem

    - by iFloh
    Hi, and again my array of arrays ... I try to improve my app performance by buffering arrays on file for later reuse. I have an NSMutableArray that contains about 30 NSMutableArrays with NSNumber, NSDate and NSString Objects. I try to write the file using this call: bool result = [myArray writeToFile:[fileMethods getFullPath:[NSString stringWithFormat:@"iEts%@.arr", [aDate shortDateString]]] atomically:NO]; = result = FALSE. The Path method is: + (NSString *) getFullPath:(NSString *)forFileName { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; return [documentsDirectory stringByAppendingPathComponent:forFileName]; } and the aDate call returns a shortDateString with ddMMyy. The NSLog NSLog(@"%@", [fileMethods getFullPath:[NSString stringWithFormat:@"iEts%@.arr", [aDate shortDateString]]]); on the path generation returns: /Users/me/Library/Application Support/iPhone Simulator/User/Applications/86729620-EC1D-4C10-A799-0C638BB27933/Documents/iEts010510.arr FURTHER: It must have something to do with the Array of Arrays, since I also write 3 further simple arrays (containing NSStrings) that all succeed. The Array of Arrays gets generated using the addObject method Any ideas what could cause the trouble?

    Read the article

  • Writing to the DataContext

    - by user738383
    I have a function. This function takes an IEnumerable<Customer> (Customer being an entity). What the function needs to do is tell the DataContext (which has a collection of Customers as a property) that its Customers property needs to be overwritten with this passed in IEnumerable<Customer>. I can't use assignment because DomainContext.Customers cannot be assigned to, as it is read only. I guess it's not clear what I'm asking, so I suppose I should say... how do I do that? So we have DataContext.Customers (of type System.Data.Linq.Table) which wants to be replaced with a System.Collections.Generic.IEnumerable. I can't just assign the latter to the former because DataContext's properties are read only. But there must be a way. Edit: here's an image: Further edit: Yes, this image does not feature a collection of the type 'Customer' but rather 'Connection'. It doesn't matter though, they are both created from tables within the linked SQL database. So there is a dc.Connections, a dc.Customers, a dc.Media and so on. Thanks in advance.

    Read the article

  • Writing a printList method for a Scheme interpreter in C

    - by Rehan Rasool
    I am new to C and working on making an interpreter for Scheme. I am trying to get a suitable printList method to traverse through the structure. The program takes in an input like: (a (b c)) and internally represent it as: [""][ ][ ]--> [""][ ][/] | | ["A"][/][/] [""][ ][ ]--> [""][ ][/] | | ["B"][/][/] ["C"][/][/] Right now, I just want the program to take in the input, make the appropriate cell structure internally and print out the cell structure, thereby getting (a (b c)) at the end. Here is my struct: typedef struct conscell *List; struct conscell { char symbol; struct conscell *first; struct conscell *rest; }; void printList(char token[20]){ List current = S_Expression(token, 0); printf("("); printf("First Value? %c \n", current->first->symbol); printf("Second value? %c \n", current->rest->first->first->symbol); printf("Third value? %c \n", current->rest->first->rest->first->symbol); printf(")"); } In the main method, I get the first token and call: printList(token); I tested the values again for the sublists and I think it is working. However, I will need a method to traverse through the whole structure. Please look at my printList code again. The print calls are what I have to type, to manually get the (a (b c)) list values. So I get this output: First value? a First value? b First value? c It is what I want, but I want a method to do it using a loop, no matter how complex the structure is, also adding brackets where appropriate, so in the end, I should get: (a (b c)) which is the same as the input. Can anyone please help me with this?

    Read the article

  • writing javascripts function using jquery

    - by tazim
    Some template written using jquery is as follows . it is not working . Any suggestions to use jquery efficiently . <html> <head> <script type="text/javascript" src="/jquerycall/"></script> <script type="text/javascript"> $(document).ready(function() { self.setInterval("clock()",1000); $("button").click(function() { clock; }); function clock() { clock(); time=new Date(); var s = "<p>" + time + "</p>"; $(s).appendTo("div"); } }); </script> </head> <body> <form method="post"> <button type="button">Click Me</button> <div id="someid"></div> </form> </body> </html>

    Read the article

  • Writing a script to bypass college login page

    - by gtredcvb
    My college has a silly login page that requires you to download a whole bunch of garbage that a lot of us don't need (Norton Anti-virus, Antispyware software, etc.). We have to have them running to get on the internet on campus. Though, if you are on Linux, or at least set your user-agent to linux, the requirements are gone. We could easily use Firefox with the useragent switcher to bypass this, but it'd be nice to create a script that automates this. How would this be possible? I figure this could be written in python, and could grab the webpage with curl specifying a user agent? How would I go about posting the data back to the servers? Thanks

    Read the article

  • Writing Lucene StandardAnalyzer results to text file with OutputStreamWriter

    - by user3693192
    I'm getting ONLY the last result written to "outputStreamFile.txt". Can't figure out how to revise code so I can get ALL results written to text file. Sample input text: "1st line of text\n" "2nd line of text \n" Results in only 2nd line begin written (and not 1st line) as: "2nd line text\n" private static void analyze(String text) throws IOException { analyzer = new StandardAnalyzer(Version.LUCENE_30); Reader r = new StringReader(text); TokenStream ts = (TokenStream) analyzer.tokenStream("", r); TermAttribute term = ts.addAttribute(TermAttribute.class); File outfile = new File("C:\\Users\\Desktop\\outputStreamFile.txt"); FileOutputStream fileOutputStream = new FileOutputStream(outfile); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream, "UTF8"); while(ts.incrementToken()) { //System.out.print(term.term() + " "); outputStreamWriter.write(term.term().toString() + "\r\n"); } outputStreamWriter.close(); }

    Read the article

  • Writing bash script for X-11 forwarding

    - by Bruce
    I was having problem with SSH X-11 forwarding while I used sudo. I found a solution for it. $hostname server4.a.b.edu First I do: $ echo $DISPLAY localhost:10.0 then $ xauth list server1.a.b.edu/unix:12 MIT-MAGIC-COOKIE-1 6026864294a0e081ac452e8740bcd0fe server4.a.b.edu/unix:10 MIT-MAGIC-COOKIE-1 f01fbfe0c0d68e30b45afe3829b27e58 Then I need to do $ sudo xauth add server4.a.b.edu/unix:10 MIT-MAGIC-COOKIE-1 f01fbfe0c0d68e30b45afe3829b27e58 for sudo to work, for the cookie with my server name and display. How do I write a bash script to automate this?

    Read the article

  • Reading and writing in parallel

    - by Malfist
    I want to be able to read and write a large file in parallel, or if not in parallel, at least in blocks so that I don't use up so much memory. This is my current code: // Define memory stream which will be used to hold encrypted data. MemoryStream memoryStream = new MemoryStream(); // Define cryptographic stream (always use Write mode for encryption). CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write); //start encrypting using (BinaryReader reader = new BinaryReader(File.Open(fileIn, FileMode.Open))) { byte[] buffer = new byte[1024 * 1024]; int read = 0; do { read = reader.Read(buffer, 0, buffer.Length); cryptoStream.Write(buffer, 0, read); } while (read == buffer.Length); } // Finish encrypting. cryptoStream.FlushFinalBlock(); // Convert our encrypted data from a memory stream into a byte array. //byte[] cipherTextBytes = memoryStream.ToArray(); //write our memory stream to a file memoryStream.Position = 0; using (BinaryWriter writer = new BinaryWriter(File.Open(fileOut, FileMode.Create))) { byte[] buffer = new byte[1024 * 1024]; int read = 0; do { read = memoryStream.Read(buffer, 0, buffer.Length); writer.Write(buffer, 0, read); } while (read == buffer.Length); } // Close both streams. memoryStream.Close(); cryptoStream.Close(); As you can see, it reads the entire file into memory, encrypts it, then writes it out. If I happen to be encrypting files that are very large (2GB+) it tends not to work, or at the very least, consumes ~97% of my memory. How could I do it in a more effective manner?

    Read the article

  • writing a scrip in java

    - by giri
    Hi I am working with telecom company.I am familiar with java programming language.But now I have a task to write a script , with linux operating systems.I have to write a script for fetching data from other computer and check some conditions. How can I do that using Java. Plz help me. Thanks.

    Read the article

  • Writing text file on local server MVC 2.0

    - by Liado
    Hi, i'm trying to write a text file on remote server, i'm using the following code: [AcceptVerbs(HttpVerbs.Post)] public ActionResult Index(UserModels model) { if (!ModelState.IsValid) { return View("Index"); } try { using (StreamWriter w = new StreamWriter(Server.MapPath(TEXT_FILE_NAME), true)) { w.WriteLine(model.Email.ToString()); // Write the text } } catch { } the folder is still empty, can someone help? what should be the problem? Thanks

    Read the article

  • Writing to an xml file with xmllite?

    - by Chris
    I have an xml file which holds a set of "game" nodes (which contain details about saved gameplay, as you'd save your game on any console game). All of this is contained within a "games" root node. I'm implementing save functionality to this xml file and wish to be able to append or overwrite a "game" node and its child nodes within the "games" root node. How can this be accomplished with xmllite.dll?

    Read the article

  • Create whole path automatically when writing to a new file

    - by Bernhard V
    Hi, I want to write a new file with the Java FileWriter. I use it like this: FileWriter newJsp = new FileWriter("C:\\user\Desktop\dir1\dir2\filename.txt"); Now the dir1 and dir2 currently don't exist. I want Java to create them automatically if they aren't already there. Actually Java should set up the whole file path if not already existing. How can I achieve this?

    Read the article

  • Writing String into a File

    - by Halo
    I'm implementing a WebScript using Alfresco's JavaScript. l'm trying to insert string to a file, but I can't do it. When I write another file's content like: file.properties.content.write(content); It works, and the file's contents are copied into my file. But I can't insert string directly, like: file.properties.content.write("Stuff like that"); it gives an exception. How can I write string into this file?

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >