انجمن وب سایت مشاوره در زمینه پروژه های برنامه نویسی و طراحی وب سایتهای تجاری
نکته های مفید و حرفه ای در سی شارپ C# - نسخه‌ی قابل چاپ

+- انجمن وب سایت مشاوره در زمینه پروژه های برنامه نویسی و طراحی وب سایتهای تجاری (http://forum.a00b.com)
+-- انجمن: سوالها و مقاله های آموزشی (/forumdisplay.php?fid=1)
+--- انجمن: مقاله های آموزشی (/forumdisplay.php?fid=3)
+--- موضوع: نکته های مفید و حرفه ای در سی شارپ C# (/showthread.php?tid=26)

صفحه‌ها: 1 2 3


متد تبدیل اعداد انگلیسی به اعداد کاملا فارسی - ali - 12-28-2014 08:59 AM

برای استفاده از این متد میتوانید کل متن را به این متد ارسال فرمائید و در خروجی کلیه اعداد که داخل متن است به صورت انگلیسی نمایش داده می شوند.
کد:
public static string UDF_ConvertNumEn2Fa(String Str_Input)
        {
            String Str_Result = String.Empty;
            foreach (char c in Str_Input.ToCharArray())
            {
                switch (c)
                {
                    case '0':
                        Str_Result += "٠";
                        break;
                    case '1':
                        Str_Result += "١";
                        break;
                    case '2':
                        Str_Result += "٢";
                        break;
                    case '3':
                        Str_Result += "٣";
                        break;
                    case '4':
                        Str_Result += "۴";
                        break;
                    case '5':
                        Str_Result += "۵";
                        break;
                    case '6':
                        Str_Result += "۶";
                        break;
                    case '7':
                        Str_Result += "٧";
                        break;
                    case '8':
                        Str_Result += "٨";
                        break;
                    case '9':
                        Str_Result += "٩";
                        break;
                    default:
                        Str_Result += c;
                        break;
                }
            }
            return Str_Result;
        }



متد تبدیل دیتا گرید ویو به دیتا تیبل datagrdiview to datatable C# - ali - 01-02-2015 12:50 PM

برای مقدار پارامتر minRow هم میتونین عدد صفر رو ارسال بفرمائین و مقدار پارامتر tblName هم یک عنوان دلخواه به صورت String می باشد.
کد:
public static DataTable DataGridView2DataTable(DataGridView dgv, String tblName, int minRow)
        {
        
          DataTable dt = new DataTable(tblName);
                
          // Header columns
          foreach (DataGridViewColumn column in dgv.Columns)
          {
            //DataColumn dc = new DataColumn(column.Name.ToString());
              if (column.Visible != false)
              {
                  DataColumn dc = new DataColumn(column.HeaderText.ToString());
                  dt.Columns.Add(dc);
              }
          }
        
          // Data cells
          for (int i = 0; i < dgv.Rows.Count; i++)
          {
                  DataGridViewRow row = dgv.Rows[i];
                  DataRow dr = dt.NewRow();
                  for (int j = 0; j < dgv.Columns.Count; j++)
                  {
                      try
                      {
                          dr[j] = (row.Cells[j].Value == null) ? "" : row.Cells[j].Value.ToString();
                      }
                      catch { }
                  }
                  dt.Rows.Add(dr);
              
              
          }
        
          // Related to the bug arround min size when using ExcelLibrary for export
          for (int i = dgv.Rows.Count; i < minRow; i++)
          {
            DataRow dr = dt.NewRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
              dr[j] = "  ";
            }
            dt.Rows.Add(dr);
          }
          return dt;
        }



یک کلاس پر کاربرد برای ایجاد خروجی Excel در سی شارپ Export to Excel C# - ali - 01-02-2015 09:25 PM

با استفاده از این کلاس می توانید خروجی اکسل از دیتای خود ایجاد نمایید. ورودی متد این کلاس بایستی یک دیتا ست باشد که شامل دیتاتیبل است.

کد:
using System;
using System.IO;
using System.Data;
using System.Text;

    class ExcelXMLExportHelper
    {
        // Get a string with excel's XML headers    
        private static string getXMLWorkbookTemplate()
        {
            StringBuilder sb = new StringBuilder(818);

            sb.AppendFormat(@"<?xml version=""1.0""?>{0}", Environment.NewLine);
            sb.AppendFormat(@"<?mso-application progid=""Excel.Sheet""?>{0}", Environment.NewLine);
            sb.AppendFormat(@"<Workbook xmlns=""urn:schemas-microsoft-com:office:spreadsheet""{0}", Environment.NewLine);
            sb.AppendFormat(@" xmlns:o=""urn:schemas-microsoft-com:office:office""{0}", Environment.NewLine);
            sb.AppendFormat(@" xmlns:x=""urn:schemas-microsoft-com:office:excel""{0}", Environment.NewLine);
            sb.AppendFormat(@" xmlns:ss=""urn:schemas-microsoft-com:office:spreadsheet""{0}", Environment.NewLine);
            sb.AppendFormat(@" xmlns:html=""http://www.w3.org/TR/REC-html40"">{0}", Environment.NewLine);
            sb.AppendFormat(@" <ss:Styles>{0}", Environment.NewLine);
            sb.AppendFormat(@"  <ss:Style ss:ID=""Default"" ss:Name=""Normal"">{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:Alignment ss:Vertical=""Bottom""/>{0}", Environment.NewLine);

            sb.AppendFormat(@"   <ss:Font ss:FontName=""Calibri"" x:Family=""Swiss"" ss:Size=""11"" ss:Color=""#000000""/>{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:Interior/>{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:NumberFormat/>{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:Protection/>{0}", Environment.NewLine);
            sb.AppendFormat(@"  </ss:Style>{0}", Environment.NewLine);

            sb.AppendFormat(@"  <ss:Style ss:ID=""s62"">{0}", Environment.NewLine);

            sb.AppendFormat(@"   <ss:Borders>{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:Border ss:Position=""Bottom"" ss:LineStyle=""Continuous"" ss:Weight=""1"" />{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:Border ss:Position=""Top"" ss:LineStyle=""Continuous"" ss:Weight=""1"" />{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:Border ss:Position=""Left"" ss:LineStyle=""Continuous"" ss:Weight=""1"" />{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:Border ss:Position=""Right"" ss:LineStyle=""Continuous"" ss:Weight=""1"" />{0}", Environment.NewLine);
            sb.AppendFormat(@"   </ss:Borders>{0}", Environment.NewLine);

            sb.AppendFormat(@"   <ss:Font ss:FontName=""Calibri"" x:Family=""Swiss"" ss:Size=""11"" ss:Color=""#000000""{0}", Environment.NewLine);
            sb.AppendFormat(@"    ss:Bold=""1""/>{0}", Environment.NewLine);
            sb.AppendFormat(@"  </ss:Style>{0}", Environment.NewLine);
            sb.AppendFormat(@"  <ss:Style ss:ID=""s63"">{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:NumberFormat ss:Format=""Short Date""/>{0}", Environment.NewLine);
            sb.AppendFormat(@"  </ss:Style>{0}", Environment.NewLine);


            sb.AppendFormat(@"  <ss:Style ss:ID=""s60"">{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:Alignment ss:Vertical=""Bottom""/>{0}", Environment.NewLine);

            sb.AppendFormat(@"   <ss:Borders>{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:Border ss:Position=""Bottom"" ss:LineStyle=""Continuous"" ss:Weight=""1"" />{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:Border ss:Position=""Top"" ss:LineStyle=""Continuous"" ss:Weight=""1"" />{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:Border ss:Position=""Left"" ss:LineStyle=""Continuous"" ss:Weight=""1"" />{0}", Environment.NewLine);
            sb.AppendFormat(@"   <ss:Border ss:Position=""Right"" ss:LineStyle=""Continuous"" ss:Weight=""1"" />{0}", Environment.NewLine);
            sb.AppendFormat(@"   </ss:Borders>{0}", Environment.NewLine);

            sb.AppendFormat(@"  </ss:Style>{0}", Environment.NewLine);


            sb.AppendFormat(@" </ss:Styles>{0}", Environment.NewLine);

            sb.Append(@"{0}\r\n</Workbook>");
            return sb.ToString();
        }

        // some special characters replacement (escaping)
        private static string replaceXmlChar(string input)
        {
            input = input.Replace("&", "&amp");
            input = input.Replace("<", "&lt;");
            input = input.Replace(">", "&gt;");
            input = input.Replace("\"", "&quot;");
            input = input.Replace("'", "&apos;");
            return input;
        }

        // get the xml formatted string for an specific data cell,
        // we translate c# types to excel data types and fix the nulls
        // plus the option to give border to the cell
        private static string getCellXml(Type type, object cellData, bool hasBorder)
        {
            object data = (cellData is DBNull) ? "" : cellData;

            string border;
            if (hasBorder)
                border = @" ss:StyleID=""s60""";
            else
                border = "";

            if (type.Name.Contains("Int") || type.Name.Contains("Double") || type.Name.Contains("Decimal") || type.Name.Contains("decimal"))
            {
                return string.Format(String.Format("<Cell{0}><Data ss:Type=\"Number\">{{0}}</Data></Cell>", border), data);
            }


            if (type.Name.Contains("Date") && data.ToString() != string.Empty)
            {
                return string.Format("<Cell ss:StyleID=\"s63\"><Data ss:Type=\"DateTime\">{0}</Data></Cell>", Convert.ToDateTime(data).ToString("yyyy-MM-dd"));
            }

            decimal nad = 0;
            if (decimal.TryParse(cellData.ToString(), out nad))
            {
                return string.Format(String.Format("<Cell{0}><Data ss:Type=\"Number\">{{0}}</Data></Cell>", border), data);
            }

            return string.Format(String.Format("<Cell{0}><Data ss:Type=\"String\">{{0}}</Data></Cell>", border), replaceXmlChar(data.ToString()));
        }

        // Input Dataset, or the tables we want to export to excel
        // the Filename
        public static void ToFormattedExcel(DataSet dsInput, string filename)
        {
            // we get the xml headers first
            string excelTemplate = getXMLWorkbookTemplate();


            string tablas = "<Worksheet ss:Name=\"Result\">";

            tablas += "\r\n<Table>\r\n";

            foreach (DataTable dt in dsInput.Tables)
            {
                tablas += GetExcelTableXml(dt, true);
            }
            tablas += "\r\n</Table>\r\n";
            tablas += "\r\n</Worksheet>";

            string excelXml = string.Format(excelTemplate, tablas);

            // now we write the file
            try
            {
                File.Delete(filename);
                StreamWriter sw = new StreamWriter(filename);

                sw.Write(excelXml);

                sw.Flush();
                sw.Close();

                sw.Dispose();
                sw = null;
            }
            catch { return; }

        }

        // loop the datatable and make the excel xml for the titles
        // and the data cells
        public static string GetExcelTableXml(DataTable dt, bool hasBorder)
        {
            string result = "";

            //write column name row
            result = "\r\n<Row>";

            foreach (DataColumn dc in dt.Columns)
            {
                result += string.Format("<Cell ss:StyleID=\"s62\"><Data ss:Type=\"String\">{0}</Data></Cell>", replaceXmlChar(dc.ColumnName));
            }
            result += "\r\n</Row>";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                result += "\r\n<Row>";

                foreach (DataColumn dc in dt.Columns)
                {
                    result += getCellXml(dc.DataType, dt.Rows[i][dc.ColumnName], hasBorder);
                }

                result += "</Row>";
            }

            return result;
        }

  }

نحوه استفاده هم به شکل زیر می باشد:
کد:
ExcelXMLExportHelper.ToFormattedExcel(DataSet, "C:\\fileName.xls");



نحوه پاک کردن تمامی فیلدهای متنی موجود بر روی فرم در سی شارپ C# - ali - 01-05-2015 05:53 AM

کد:
/// <summary>
        /// متد حذف مقادیر داخل فیلدهای متنی
        /// </summary>
        /// <param name="cc"></param>
        private static void UDF_ClearTextBoxes(Control.ControlCollection cc)
        {
            foreach (Control ctrl in cc)
            {
                TextBox tb = ctrl as TextBox;
                if (tb != null)
                    tb.Text = "";
                else
                    UDF_ClearTextBoxes(ctrl.Controls);
            }
        }
نحوه استفاده از متد:
کد:
UDF_ClearTextBoxes(this.Controls);



مسیج باکس Right To Left در سی شارپ C# - ali - 01-06-2015 06:49 PM

right to left شدن متن در messagebox در سی شارپ
کد:
MessageBox.Show("اطلاعاتي جهت حذف وجود ندارد.", "خطا", MessageBoxButtons.OK,
                    MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                    MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading);



خطای Corrupt .resources file. Got an unexpected EndOfStreamException while trying to - ali - 02-24-2015 02:49 PM

رفع خطای Corrupt .resources file. Got an unexpected EndOfStreamException while trying to read the ResourceReader header. در پروژه های ویژوال استدیو
برخی اوقات و بیشتر در زمانی که یک سری کامپوننت قدیمی را از پروژه حذف می کنیم و یا اینکه ویرایش در فرمها و کامپوننتها بالا می رود ، در هنگام کامپایل پروژه با پیغام خطای فوق مواجه می شویم. برای رفع این مشکل باید به روش زیر عمل نماییم:

کد:
1: from the main menu click on -> Build
2: click on Clean solutions
3: click on Clean 'نام پروژه'
4: Then finally Re-build your project



رفع اشکال عدم کامپایل پروژه در ویژوال استدیو - ali - 02-27-2015 10:59 AM

برخی از مواقع و بیشتر در مواقعی که از کامپوننتهای User Control تولید شده در نسخه های قدیمی در نسخه های ویژوال استدیوی نسخه بالاتر استفاده می نمایید ، ممکن است که برنامه کامپایل نشود و یک حالت قفل شدن به ویژوال استدیو مخصوصا در ویندوزها 64 بیتی اتفاق بیفتد. برای رفع این مشکل راه حل زیر پیشنهاد می شود:

کد:
1- Tools >> Options >> Project and Solution >> Build and Run >> Check that "On run, when projects are out of date" is set to "Always build" or "Prompt to build"
2- Build >> Configuration Manager >> Check that "Build"

پس از انجام این تغیییرات پروژه را یک بار ببندید و دوباره آن را باز کنید و اجرا نمایید.


ارسال کوئری Query دلخواه به Stimulsoft Report - ali - 03-20-2015 09:44 AM

توسط تکه کد زیر می توانید یک کوئری دلخواه را به گزارش Stimulsoft Report ارسال بفرمائین به طوری که این گزارش بصورت فایل جداگانه ذخیره نشود (داخل همون فایل Exe پروژه باشد) و ضمنا در هر بار درخواست گزارش هم ریفرش شود و اطلاعات فیلتر شده جدید در آن نمایش داده شود.
کد:
StiReport Report = new StiReport();
Report = (StiReport)stiReport1.Clone();
Report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", "Connection", Properties.Settings.Default.YourProjectConnectionString.ToString().Trim(), false));
Stimulsoft.Report.Dictionary.StiSqlSource sqlSource = (Report.Dictionary.DataSources[0] as Stimulsoft.Report.Dictionary.StiSqlSource);
sqlSource.SqlCommand = "YourSqlQuery";
Report.Dictionary.Synchronize();
Report.Show();

ضمنا این فایل Name Space هم باید در بالای صفحه کد نوشته بشه:

کد:
using Stimulsoft.Report;



کلاس و متد تبدیل کارکترهای داس به ویندوز dos to windows converter - ali - 03-20-2015 10:10 AM

از کلاس و متد زیر می تونین برای تبدیل کدهای قدیمی DOS به ویندوز استفاده کنین. البته این کلاس مربوط به تبدیل کدهایی میشه که در برنامه ورود و خروج PW تحت داس استفاده میشه. این برنامه ورود و خروج پرسنل که به دستگاه PW کارت ساعت زن پرسنل وصل میشه قابلیت این رو داره که ورود و خروجهای پرسنل رو به صورت فایل DBF یا همون Fox pro database (فایل پایگاه داده فاکس پرو) منتشر بکنه. با این کلاس می تونین دیتای اون نوع فایل رو تبدیل کنین. ورودی به صورت Int16 و خروجی هم به صورت استرینگ.

کد:
using System;
using System.Collections.Generic;
using System.Text;

namespace PwConvertor
{
    sealed class  Class_ConverToWin
    {
        Int16 Int16_InputCahr;
        String Str_OutputChar;

        public Class_ConverToWin(Int16 Int16_InputCharacter)
        {
            this.Int16_InputCahr = Int16_InputCharacter;
        }

        public String UDF_ReturnChar1()
        {
            switch (this.Int16_InputCahr)
            {
                case 1617:
                    this.Str_OutputChar = "ا";
                    break;
                case 144:
                    this.Str_OutputChar = "ا";
                    break;
                case 141:
                    this.Str_OutputChar = "آ";
                    break;
                case 1618:
                    this.Str_OutputChar = "ب";
                    break;
                case 244:
                    this.Str_OutputChar = "ب";
                    break;
                case 164:
                    this.Str_OutputChar = "پ";
                    break;
                case 1600:
                    this.Str_OutputChar = "پ";
                    break;
                case 251:
                    this.Str_OutputChar = "ت";
                    break;
                case 249:
                    this.Str_OutputChar = "ت";
                    break;
                case 1569:
                    this.Str_OutputChar = "ث";
                    break;
                case 1570:
                    this.Str_OutputChar = "ث";
                    break;
                case 1571:
                    this.Str_OutputChar = "ج";
                    break;
                case 1572:
                    this.Str_OutputChar = "ج";
                    break;
                case 163:
                    this.Str_OutputChar = "چ";
                    break;
                case 1573:
                    this.Str_OutputChar = "چ";
                    break;
                case 1574:
                    this.Str_OutputChar = "ح";
                    break;
                case 1575:
                    this.Str_OutputChar = "ح";
                    break;
                case 1576:
                    this.Str_OutputChar = "خ";
                    break;
                case 1577:
                    this.Str_OutputChar = "خ";
                    break;
                case 1578:
                    this.Str_OutputChar = "د";
                    break;
                case 1579:
                    this.Str_OutputChar = "ذ";
                    break;
                case 1580:
                    this.Str_OutputChar = "ر";
                    break;
                case 1581:
                    this.Str_OutputChar = "ز";
                    break;
                case 1582:
                    this.Str_OutputChar = "ژ";
                    break;
                case 1583:
                    this.Str_OutputChar = "س";
                    break;
                case 1584:
                    this.Str_OutputChar = "س";
                    break;
                case 1585:
                    this.Str_OutputChar = "ش";
                    break;
                case 1586:
                    this.Str_OutputChar = "ش";
                    break;
                case 1587:
                    this.Str_OutputChar = "ص";
                    break;
                case 1588:
                    this.Str_OutputChar = "ص";
                    break;
                case 1589:
                    this.Str_OutputChar = "ض";
                    break;
                case 171:
                    this.Str_OutputChar = "ض";
                    break;
                case 187:
                    this.Str_OutputChar = "ط";
                    break;
                case 1590:
                    this.Str_OutputChar = "ظ";
                    break;
                case 1591:
                    this.Str_OutputChar = "ع";
                    break;
                case 1594:
                    this.Str_OutputChar = "ع";
                    break;
                case 1592:
                    this.Str_OutputChar = "ع";
                    break;
                case 1593:
                    this.Str_OutputChar = "ع";
                    break;
                case 1601:
                    this.Str_OutputChar = "غ";
                    break;
                case 181:
                    this.Str_OutputChar = "غ";
                    break;
                case 1602:
                    this.Str_OutputChar = "غ";
                    break;
                case 1603:
                    this.Str_OutputChar = "غ";
                    break;
                case 1604:
                    this.Str_OutputChar = "ف";
                    break;
                case 1605:
                    this.Str_OutputChar = "ف";
                    break;
                case 1606:
                    this.Str_OutputChar = "ق";
                    break;
                case 1607:
                    this.Str_OutputChar = "ق";
                    break;
                case 1608:
                    this.Str_OutputChar = "ک";
                    break;
                case 1609:
                    this.Str_OutputChar = "ک";
                    break;
                case 1610:
                    this.Str_OutputChar = "گ";
                    break;
                case 8801:
                    this.Str_OutputChar = "گ";
                    break;
                case 1611:
                    this.Str_OutputChar = "ل";
                    break;
                case 1612:
                    this.Str_OutputChar = "لا";
                    break;
                case 1613:
                    this.Str_OutputChar = "ل";
                    break;
                case 1614:
                    this.Str_OutputChar = "م";
                    break;
                case 1615:
                    this.Str_OutputChar = "م";
                    break;
                case 1616:
                    this.Str_OutputChar = "ن";
                    break;
                case 8776:
                    this.Str_OutputChar = "ن";
                    break;
                case 176:
                    this.Str_OutputChar = "و";
                    break;
                case 8729:
                    this.Str_OutputChar = "ه";
                    break;
                case 8730:
                    this.Str_OutputChar = "ه";
                    break;
                case 183:
                    this.Str_OutputChar = "ه";
                    break;
                case 8319:
                    this.Str_OutputChar = "ی";
                    break;
                case 9632:
                    this.Str_OutputChar = "ی";
                    break;
                case 178:
                    this.Str_OutputChar = "ی";
                    break;
                case 128:
                    this.Str_OutputChar = "0";
                    break;
                case 129:
                    this.Str_OutputChar = "1";
                    break;
                case 233:
                    this.Str_OutputChar = "2";
                    break;
                case 226:
                    this.Str_OutputChar = "3";
                    break;
                case 132:
                    this.Str_OutputChar = "4";
                    break;
                case 224:
                    this.Str_OutputChar = "5";
                    break;
                case 134:
                    this.Str_OutputChar = "6";
                    break;
                case 231:
                    this.Str_OutputChar = "7";
                    break;
                case 234:
                    this.Str_OutputChar = "8";
                    break;
                case 235:
                    this.Str_OutputChar = "9";
                    break;
                case 47:
                    this.Str_OutputChar = "\\";
                    break;
                case 142:
                    this.Str_OutputChar = "ئ";
                    break;
                case 143:
                    this.Str_OutputChar = "ء";
                    break;
                case 239:
                    this.Str_OutputChar = "-";
                    break;
                case 45:
                    this.Str_OutputChar = "_";
                    break;
                case 232:
                    this.Str_OutputChar = "،";
                    break;
                case 33:
                    this.Str_OutputChar = "!";
                    break;
                case 96:
                    this.Str_OutputChar = "'";
                    break;
                case 238:
                    this.Str_OutputChar = "؟";
                    break;
                default:
                    this.Str_OutputChar = ((Char)this.Int16_InputCahr).ToString();
                    break;
            }
            return Str_OutputChar;
        }

        public String UDF_ReturnChar()
        {
            switch (this.Int16_InputCahr)
            {
                case 8216:
                    this.Str_OutputChar = "ا";
                    break;
                case 1711:
                    this.Str_OutputChar = "ا";
                    break;
                case 1670:
                    this.Str_OutputChar = "آ";
                    break;
                case 8220:
                    this.Str_OutputChar = "ب";
                    break;
                case 8217:
                    this.Str_OutputChar = "ب";
                    break;
                case 8221:
                    this.Str_OutputChar = "پ";
                    break;
                case 8226:
                    this.Str_OutputChar = "پ";
                    break;
                case 8211:
                    this.Str_OutputChar = "ت";
                    break;
                case 8212:
                    this.Str_OutputChar = "ت";
                    break;
                case 1705:
                    this.Str_OutputChar = "ث";
                    break;
                case 8482:
                    this.Str_OutputChar = "ث";
                    break;
                case 1681:
                    this.Str_OutputChar = "ج";
                    break;
                case 8250:
                    this.Str_OutputChar = "ج";
                    break;
                case 339:
                    this.Str_OutputChar = "چ";
                    break;
                case 8204:
                    this.Str_OutputChar = "چ";
                    break;
                case 8205:
                    this.Str_OutputChar = "ح";
                    break;
                case 1722:
                    this.Str_OutputChar = "ح";
                    break;
                case 1548:
                    this.Str_OutputChar = "خ";
                    break;
                case 1577:
                    this.Str_OutputChar = "خ";
                    break;
                case 162:
                    this.Str_OutputChar = "د";
                    break;
                case 163:
                    this.Str_OutputChar = "ذ";
                    break;
                case 164:
                    this.Str_OutputChar = "ر";
                    break;
                case 165:
                    this.Str_OutputChar = "ز";
                    break;
                case 166:
                    this.Str_OutputChar = "ژ";
                    break;
                case 167:
                    this.Str_OutputChar = "س";
                    break;
                case 168:
                    this.Str_OutputChar = "س";
                    break;
                case 169:
                    this.Str_OutputChar = "ش";
                    break;
                case 1726:
                    this.Str_OutputChar = "ش";
                    break;
                case 171:
                    this.Str_OutputChar = "ص";
                    break;
                case 172:
                    this.Str_OutputChar = "ص";
                    break;
                case 173:
                    this.Str_OutputChar = "ض";
                    break;
                case 174:
                    this.Str_OutputChar = "ض";
                    break;
                case 175:
                    this.Str_OutputChar = "ط";
                    break;
                case 224:
                    this.Str_OutputChar = "ظ";
                    break;
                case 1604:
                    this.Str_OutputChar = "ع";
                    break;
                case 226:
                    this.Str_OutputChar = "ع";
                    break;
                case 1605:
                    this.Str_OutputChar = "ع";
                    break;
                case 1606:
                    this.Str_OutputChar = "ع";
                    break;
                case 1607:
                    this.Str_OutputChar = "غ";
                    break;
                case 232:
                    this.Str_OutputChar = "غ";
                    break;
                case 1608:
                    this.Str_OutputChar = "غ";
                    break;
                case 231:
                    this.Str_OutputChar = "غ";
                    break;
                case 233:
                    this.Str_OutputChar = "ف";
                    break;
                case 234:
                    this.Str_OutputChar = "ف";
                    break;
                case 235:
                    this.Str_OutputChar = "ق";
                    break;
                case 1609:
                    this.Str_OutputChar = "ق";
                    break;
                case 1610:
                    this.Str_OutputChar = "ک";
                    break;
                case 238:
                    this.Str_OutputChar = "ک";
                    break;
                case 239:
                    this.Str_OutputChar = "گ";
                    break;
                case 1611:
                    this.Str_OutputChar = "گ";
                    break;
                case 1614:
                    this.Str_OutputChar = "ل";
                    break;
                case 1613:
                    this.Str_OutputChar = "لا";
                    break;
                case 1612:
                    this.Str_OutputChar = "ل";
                    break;
                case 244:
                    this.Str_OutputChar = "م";
                    break;
                case 1615:
                    this.Str_OutputChar = "م";
                    break;
                case 1616:
                    this.Str_OutputChar = "ن";
                    break;
                case 247:
                    this.Str_OutputChar = "ن";
                    break;
                case 1617:
                    this.Str_OutputChar = "و";
                    break;
                case 1618:
                    this.Str_OutputChar = "ه";
                    break;
                case 249:
                    this.Str_OutputChar = "ه";
                    break;
                case 251:
                    this.Str_OutputChar = "ه";
                    break;
                case 8206:
                    this.Str_OutputChar = "ی";
                    break;
                case 8207:
                    this.Str_OutputChar = "ی";
                    break;
                case 252:
                    this.Str_OutputChar = "ی";
                    break;
                case 8364:
                    this.Str_OutputChar = "0";
                    break;
                case 1662:
                    this.Str_OutputChar = "1";
                    break;
                case 8218:
                    this.Str_OutputChar = "2";
                    break;
                case 402:
                    this.Str_OutputChar = "3";
                    break;
                case 8222:
                    this.Str_OutputChar = "4";
                    break;
                case 8230:
                    this.Str_OutputChar = "5";
                    break;
                case 8224:
                    this.Str_OutputChar = "6";
                    break;
                case 8225:
                    this.Str_OutputChar = "7";
                    break;
                case 710:
                    this.Str_OutputChar = "8";
                    break;
                case 8240:
                    this.Str_OutputChar = "9";
                    break;
                case 47:
                    this.Str_OutputChar = "\\";
                    break;
                case 1688:
                    this.Str_OutputChar = "ئ";
                    break;
                case 1672:
                    this.Str_OutputChar = "ء";
                    break;
                //case 239:
                //    this.Str_OutputChar = "-";
                //    break;
                case 45:
                    this.Str_OutputChar = "_";
                    break;
                //case 232:
                //    this.Str_OutputChar = "،";
                //    break;
                case 33:
                    this.Str_OutputChar = "!";
                    break;
                case 96:
                    this.Str_OutputChar = "'";
                    break;
                case 338:
                    this.Str_OutputChar = "؟";
                    break;
                default:
                    this.Str_OutputChar = ((Char)this.Int16_InputCahr).ToString();
                    break;
            }
            return Str_OutputChar;
        }
    }
}
DOS TO WINDOWS CONVERTOR


راه حل پیغام خطای stimulsoft.report.stireportLangugeType - ali - 01-04-2016 08:31 PM

راه حل پیغام خطای The type or namespace name 'StiReport' does not exist in the namespace 'Stimulsoft.Report' (are you missing an assembly reference?) در برنامه استیمولسافت ریپورت در ویژوال استدیوی 2010


معمولا خطای فوق به علت عدم تطابق ورژن دات نت فریم ورک نمایش داده می شود. برای رفع این اشکال بر روی نام پروژه در ویژوال استدیو Right Click نموده و بر روی Properties کلیک نمایید تا صفحه مربوط به تنظیمات پروژه نمایش داده شود. سپس در بخش Application بر روی گزینه Target framework رفته و گزینه
کد:
.NET Framework 4
را انتخاب فرمائید. (شکل زیر)


[تصویر:  6358757403453051590StiReportError.jpg]