当前位置: 首页>>代码示例>>C#>>正文


C# Telerik.GetExtension方法代码示例

本文整理汇总了C#中Telerik.GetExtension方法的典型用法代码示例。如果您正苦于以下问题:C# Telerik.GetExtension方法的具体用法?C# Telerik.GetExtension怎么用?C# Telerik.GetExtension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Telerik的用法示例。


在下文中一共展示了Telerik.GetExtension方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSavedFile

        public static string GetSavedFile(Telerik.Web.UI.UploadedFile fUploader, bool autoGenerateName)
        {
            string guid = string.Empty;

            if (fUploader != null)
            {
                try
                {
                    if (!fUploader.FileName.Contains('.'))
                        return guid;

                    if (autoGenerateName)
                    {
                        guid = Guid.NewGuid().ToString();
                        guid += fUploader.GetExtension();
                    }
                    else
                        guid = fUploader.GetName();
                    if (File.Exists(ExpressoConfig.GeneralConfigElement.GetPhysicalUploadPath + "\\" + guid))
                    {
                        guid = fUploader.GetNameWithoutExtension() + "_" + Guid.NewGuid().ToString().Substring(0, 3).ToString() + fUploader.GetExtension();
                    }
                    fUploader.SaveAs(ExpressoConfig.GeneralConfigElement.GetPhysicalUploadPath + "\\" + guid);

                }


                catch (Exception ex)
                {
                    throw ex;
                }

            }
            return guid;
        }
开发者ID:yalhami,项目名称:eXpresso,代码行数:35,代码来源:Utilities.cs

示例2: FillFileInfo

		private void FillFileInfo(Telerik.Web.UI.UploadedFile file, ref Services.FileSystem.FileInfo fileInfo)
		{
			//The core API expects the path to be stripped off the filename
			fileInfo.FileName = ((file.FileName.Contains("\\")) ? Path.GetFileName(file.FileName) : file.FileName);
			fileInfo.Extension = file.GetExtension();
			if (fileInfo.Extension.StartsWith("."))
			{
				fileInfo.Extension = fileInfo.Extension.Remove(0, 1);
			}

			fileInfo.ContentType = FileSystemUtils.GetContentType(fileInfo.Extension);

			FillImageInfo(file.InputStream, ref fileInfo);
		}
开发者ID:hungnt-me,项目名称:Dnn.Platform,代码行数:14,代码来源:TelerikFileBrowserProvider.cs

示例3: GetSavedFileforGallery

        public static string GetSavedFileforGallery(Telerik.Web.UI.UploadedFile fUploader, bool autoGenerateName, bool generateThumbnail)
        {
            string guid = string.Empty;

            if (fUploader != null)
            {
                try
                {

                    if (!fUploader.FileName.Contains('.'))
                        return guid;

                    if (autoGenerateName)
                    {
                        guid = Guid.NewGuid().ToString();
                        guid += fUploader.GetExtension();
                    }
                    else
                        guid = fUploader.GetName();
                    if (!Directory.Exists((ConfigContext.GetGalleryUploadPath)))
                    {
                        Directory.CreateDirectory((ConfigContext.GetGalleryUploadPath));
                    }
                    fUploader.SaveAs(ConfigContext.GetGalleryUploadPath + guid);

                    //Generate Thumbnail
                    if (generateThumbnail)
                    {
                        Bitmap thumbnail = CreateThumbnail(ConfigContext.GetGalleryUploadPath + guid, 180, 140);
                        thumbnail.Save(ConfigContext.GetGalleryUploadPath + "Thumb-" + guid);
                    }


                }
                catch (Exception ex)
                {
                    throw ex;
                }

            }
            return guid;
        }
开发者ID:yalhami,项目名称:eXpresso,代码行数:42,代码来源:Utilities.cs


注:本文中的Telerik.GetExtension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。