formatexception

    2熱度

    2回答

    爲什麼此代碼拋出異常? var dateTime = "2012-03-21_15.12"; var format = new DateTimeFormatInfo() { FullDateTimePattern = "yyyy-MM-dd-HH_mm.ss" }; // FormatException: String was not recognized as a valid

    0熱度

    3回答

    我一直在我嘗試爲銷售變量賦值的行上的每個案例中都收到一個FormatException。任何人都知道我在做什麼錯了?我應該讓這個控制檯程序作爲家庭作業來了解循環,但是我發現更多關於其他的東西。它應該根據每次銷售的10%的佣金保留銷售員佣金的運行標籤。不管怎麼說,這裏是代碼: using System; using System.Collections.Generic; using System

    0熱度

    1回答

    我的代碼給出了上述錯誤。 我曾嘗試基於下面的鏈接進行更改: String was not recognized as a valid DateTime 「 format dd/MM/yyyy」 ,但它仍然無法正常工作。 如果有人能指出我正確的方向,請將此表示謝意。 我的代碼是下面: foreach (GridViewRow row in GridView1.Rows) {

    0熱度

    1回答

    我的任務是從XML文件中檢索數據。 XML文件中的每個節點都包含日期和時間。要讀取並轉換它我使用以下: 日期= DateTime.ParseExact(turnoNode.SelectSingleNode( 「FechaHoraAlta」)的innerText, 「日/月/年爲hh:mm:ss」 的,CultureInfo.InvariantCulture) ; 對於前兩個節點它正確地轉換日期:

    2熱度

    2回答

    我已經在類ProductServices下面的方法: public bool IsDownloadAllowed(int Id, string productId) { if (CustomStringFunctions.IsGuid(productId)) { //Do Something } else { throw ne

    3熱度

    4回答

    我正在ftp服務器上創建一個文件。但是在服務器上創建文件之前,我還檢查它是否已經存在。但是,大部分系統工作正常,但我的客戶之一有問題。當他運行應用程序時,它會拋出system.formatexception i-e輸入字符串的格式不正確。 我無法理解這個問題。有誰能夠幫助我? 以下是創建文件的代碼。 public string createFile(string filename1)

    1熱度

    5回答

    讓我來解釋一下情況。在我的代碼中,我正在加密userid轉換爲註冊完成後生成的字符串。 ecrypted字符串作爲url參數傳遞,如下所示。 string ConfirmCode = string.Empty; Common.Secure.Security mySec = new Common.Secure.Security(); ConfirmCode = mySec.Encrypt(myM

    1熱度

    1回答

    嘗試將base64字符串轉換爲字節數組時,出現異常。我將圖像轉換爲字節數組,然後轉換爲base64字符串,然後對其進行加密並將其存儲在文件中。然後我試圖將Base64字符串轉換回MemoryStream中的一個字節數組,並重新創建圖像。我在這裏得到一個出現FormatException: byte[] imgBytes = Convert.FromBase64String(str); 下面是兩

    0熱度

    1回答

    對不起,再次編輯這個,而不是另一個帖子,我想我會問這裏。 public static void main(String[] args) { // TODO code application logic here char response = 0; double grossAnnualIncome = 0.0; double annualTuition = 0.0; doub

    1熱度

    1回答

    當我嘗試建立通過巡航控制我的項目,我得到的休耕錯誤: BUILD EXCEPTION Error Message: System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBu